<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>bosdyn.client.robot_command &mdash; Spot 5.0.1.1 documentation</title>
      <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
    <link rel="shortcut icon" href="../../../_static/bd-favicon.png"/>
    <link rel="canonical" href="https://dev.bostondynamics.com/_modules/bosdyn/client/robot_command.html" />
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    <script src="../../../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../../../README.html">
            
              <img src="../../../_static/bd-official-white.png" class="logo" alt="Logo"/>
          </a>
              <div class="version">
                5.0.1.1
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/concepts/README.html">Concepts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/about_spot.html">About Spot</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/orbit/about_orbit.html">About Orbit (formerly Scout)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/orbit/orbit_api.html">Orbit API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/networking.html">Networking</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/base_services.html">Base services</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/geometry_and_frames.html">Geometry and Frames</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/robot_services.html">Robot services</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/estop_service.html">E-Stop</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/keepalive_service.html">KeepAlive (BETA)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/audio_visual.html">Audio Visual</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/lease_service.html">Lease</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/developing_api_services.html">Developing API Services</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/service_customization.html">Service Customization</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/faults.html">Faults</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/autonomy/README.html">Autonomy services</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_tech_summary.html">Autonomy Technical Summary</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/autonomous_navigation_code_examples.html">Autonomous navigation code examples</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/components_of_autonomous_navigation.html">Components of autonomous navigation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/docking.html">Docking</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/typical_autonomous_navigation_use_case.html">Typical autonomous navigation use case</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/autonomous_navigation_services.html">Autonomous navigation services</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_service.html">GraphNav service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_map_structure.html">GraphNav map structure</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_area_callbacks.html">GraphNav area callbacks</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/initialization.html">Initialization</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/localization.html">Localization</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_and_robot_locomotion.html">GraphNav and robot locomotion</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/missions_service.html">Missions service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/autowalk_service.html">Autowalk service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/network_compute_bridge.html">Network compute bridge</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/auto_return.html">AutoReturn service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/directed_exploration.html">Directed Exploration</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/gps.html">GPS</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/choreography/README.html">Choreography</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreography_service.html">Choreography Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/move_reference.html">Move Reference Guide</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/custom_gait.html">CustomGait Reference</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreographer_setup.html">Choreographer Setup</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreographer.html">Choreographer Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/robot_controls_in_choreographer.html">Robot Connections in Choreographer</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/animations_in_choreographer.html">Animations in Choreography</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/animation_file_specification.html">Animation File Format</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreography_in_tablet.html">Tablet Choreography Mode</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreography_in_autowalk.html">Choreography Actions in Autowalk</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/joint_control/README.html">Joint Control API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/joint_control/supplemental_data.html">Supplemental Robot Information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../docs/concepts/joint_control/knee_torque_limits.html">Knee Torque Limits</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/arm/README.html">Spot Arm</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/arm/arm_specification.html">Arm and Gripper Specification</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/arm/arm_concepts.html">Concepts</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/arm/arm_services.html">Services</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/data.html">Spot Data</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/data_acquisition_overview.html">Data Acquisition Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/data_acquisition_output.html">Data Acquisition Output</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/writing_services_for_data_acquisition.html">Integrate Payloads with the API</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/data_buffer_overview.html">Data Buffer Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/bddf.html">BDDF File Format</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/data_acquisition_thermal_raw.html">Thermal Raw Data Format</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/python/README.html">Python</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/python/quickstart.html">Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/python/understanding_spot_programming.html">Understanding Spot Programming</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../python/examples/README.html">Examples</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/basic_service_examples.html">Basic Service Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/hello_spot/README.html">Hello Spot</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/directory/README.html">Directory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_robot_state/README.html">Get Robot State</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_robot_state_async/README.html">Get Robot State Async</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_image/README.html">Get Image</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_world_objects/README.html">Get World Objects</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_mission_state/README.html">Get Mission State</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/estop/README.html">E-Stop</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/time_sync/README.html">Time Sync</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/comms_test/README.html">Comms Test</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/disable_ir_emission/README.html">IR Enable/Disable</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/reset_safety_stop/README.html">Reset Safety Stop</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/audio_visual/audio_visual_params/README.html">Audio Visual Params</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/audio_visual/audio_visual_behaviors/README.html">Audio Visual Behaviors</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/robot_behavior_examples.html">Robot Behavior and Commands Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/stance/README.html">Stance</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/frame_trajectory_command/README.html">Frame Trajectory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/spot_light/README.html">Spot Light</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/upload_choreographed_sequence/README.html">Upload Choreographed Sequence</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/xbox_controller/README.html">Xbox Controller</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/wasd/README.html">WASD</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/docking/README.html">Docking</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/animation_recorder/README.html">Animation Recorder</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/auto_return/README.html">Auto Return</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/fan_command/README.html">Fan Commands</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_wasd/README.html">ARM WASD</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/arm_examples.html">Arm Command Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_simple/README.html">Simple Arm Motion</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_stow_unstow/README.html">Stow/unstow Arm</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_freeze/README.html">Arm Freeze</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_and_mobility_command/README.html">Arm and Mobility Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_with_body_follow/README.html">Arm Command with Body Following</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_constrained_manipulation/README.html">Arm Constrained Manipulation</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_trajectory/README.html">Arm Trajectory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_trajectory/README.html#long-trajectory">Long Trajectory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_joint_move/README.html">Arm Joint Move Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_force_control/README.html">Arm Force Control Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_grasp/README.html">Arm Grasp Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_grasp_carry_overrides/README.html">Arm Grasp and Carry Overrides</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_gaze/README.html">Arm Gaze Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_surface_contact/README.html">Arm Command with Surface Contact</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_door/README.html">Arm Door Opening Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_walk_to_object/README.html">Walk to And Pick Up Object</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_gcode/README.html">Writing Gcode</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/gripper_camera_params/README.html">Gripper Camera Parameters</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_impedance_control/README.html">Arm Impedance Control</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/inverse_kinematics/README.html">Inverse Kinematics</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_wasd/README.html">Arm WASD</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/joint_control/README.html">Wiggle Arm</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/payloads_examples.html">Payloads and Registration Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/payloads/README.html">Payloads</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/self_registration/README.html">Self Registration</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_faults/README.html">Faults</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/velodyne_client/README.html">Velodyne</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/core_io_gpio/README.html">CORE I/O GPIO</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/metrics_over_coreio/README.html">Overview</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/metrics_over_coreio/README.html#usage">Usage</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/metrics_over_coreio/README.html#components">Components</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/metrics_over_coreio/README.html#recommended-debugging">Recommended debugging</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/extensions/README.html">Extensions</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/perception_world_objects_examples.html">Perception and World Objects Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_image/README.html">Get Image</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_world_objects/README.html">Get World Objects</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/world_object_with_image_coordinates/README.html">World Object With Image Coordinates</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/world_object_mutations/README.html">World Object Mutations</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/visualizer/README.html">Visualizer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/gripper_camera_params/README.html">Gripper Camera Parameters</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/spot_cam/README.html">Spot CAM Services</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/spot_cam/README.html#spot-cam-video-core-io-extension-example">Spot Cam Video Core IO Extension Example</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/stitch_front_images/README.html">Stitch Front Images</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_depth_plus_visual_image/README.html">Project Depth Data on Visual Images</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_customization/custom_parameter_image_server/README.html">Custom Parameter Image Server</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/fiducial_follow/README.html">Fiducial Follow</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/spot_tensorflow_detector/README.html">Tensorflow Detector</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_customization/custom_parameter_ncb_worker/README.html">Custom Parameter Tensorflow Detector</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/network_compute_bridge/README.html">Machine Learning with the Network Compute Bridge</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/network_compute_bridge/fire_extinguisher_server/README.html">Fire Extinguisher Detector with the Network Compute Bridge</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/ray_cast/README.html">Ray Cast</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/user_nogo_regions/README.html">No-Go Regions</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/gps_service/README.html">GPS</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/logging_examples.html">Logging Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/bddf_download/README.html">BDDF Download</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/data_buffer/README.html">Data Buffer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/data_service/README.html">Data Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/logging/README.html">Logging</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/log_status/README.html">Log Status</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/data_acquisition_examples.html">Data Acquisition Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/data_acquisition_service/README.html">Data Acquisition Service</a><ul>
<li class="toctree-l5"><a class="reference internal" href="../../../python/examples/data_acquisition_service/signals_coreio_modem_plugin/README.html">Modem Signals</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_faults/README.html">Faults</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_customization/custom_parameter_image_server/README.html">Custom Parameter Image Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_customization/custom_parameters_data_acquisition/README.html">Custom Parameter Data Acquisition Plugin</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_image/README.html">Test Image Service Implementation with Get Image</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/post_docking_callbacks/README.html">Post Docking Callbacks</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/cloud_upload/README.html">Cloud Upload</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/comms_mapping/README.html">Comms image service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/comms_mapping/README.html#how-to-use">How to use</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/data_acquisition_service/signals_coreio_modem_plugin/README.html">CoreIO Modem Signals Plugin</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/tester_programs/README.html">Tester Programs</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/autonomy_and_missions_examples.html">Autonomy and Missions Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_anchoring_optimization/README.html">Graph Nav Anchoring Optimization</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_command_line/README.html">GraphNav and Recording Service Command Line Interfaces</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_command_line/README.html#example-programs">Example Programs</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_extract_point_cloud/README.html">Graph Nav Extract Point Cloud</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_view_map/README.html">Graph Nav View Map</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_view_gps/README.html">Graph Nav View GPS Data</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_mission_state/README.html">Get Mission State</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/remote_mission_service/README.html">Remote Mission Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/mission_question_answerer/README.html">Mission Question Answerer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/mission_recorder/README.html">Mission Recorder</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/replay_mission/README.html">Replay Mission</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/post_docking_callbacks/README.html">Post Docking Callbacks</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/area_callback/README.html">Area Callbacks</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/edit_autowalk/README.html">Edit Autowalk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/record_autowalk/README.html">Record Autowalk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/extract_images_from_walk/README.html">Extract Images from Autowalk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/network_request_callback/README.html">Network Request Callback</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/network_request_callback/README.html#id1">Network Request Callback</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/remote_mission_service/spot_check/README.html">SpotCheck Mission Service</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/joint_control_examples.html">Joint Control API Examples</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/orbit.html">Orbit</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/hello_orbit/README.html">Hello Orbit</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/export_run_archives/README.html">Export Run Archives</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/export_site_walk_archives/README.html">Export Sitewalk Archives</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/anomalies/README.html">Anomalies</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/schedule_mission/README.html">Schedule Mission</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/runs_response/README.html">Runs Response</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/send_robot_back_to_dock/README.html">Return to Dock</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/toggle_mission_based_on_weather/README.html">Mission Toggle</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/webhook/README.html">Webhook</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/backups/README.html">Backups</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/webhook_integration/README.html">Webhook Integrations</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/webhook_integration/README.html#example-overview">Example Overview</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../python/README.html">Python Reference Guide</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/README.html">Client</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback.html">Area Callback</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback_region_handler_base.html">Area Callback Region Handler</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback_service_runner.html">Area Callback Service Runner</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback_service_servicer.html">Area Callback Servicer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback_service_utils.html">Area Callback Service Utils</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/arm_surface_contact.html">Arm Surface Contact</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/async_tasks.html">Async Tasks</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/audio_visual.html">Audio Visual</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/audio_visual_helpers.html">Audio Visual Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/auth.html">Auth</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/auto_return.html">Auto Return</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/autowalk.html">Autowalk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/bddf.html">BDDF</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/bddf_download.html">BDDF Download</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/channel.html">Channel</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/command_line.html">Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/common.html">Common</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition.html">Data Acquisition</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition_helpers.html">Data Acquisition Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition_plugin.html">Data Acquisition Plugin</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition_plugin_service.html">Data Acquisition Plugin Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition_store.html">Data Acquisition Store</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_buffer.html">Data Buffer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_chunk.html">Data Chunk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_service.html">Data Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/directory_registration.html">Directory Registration</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/directory.html">Directory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/docking.html">Docking</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/door.html">Door</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html">E-Stop</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/error_callback_result.html">Error Callback Result</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/exceptions.html">Exceptions</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/fault.html">Fault</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/frame_helpers.html">Frame Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/graph_nav.html">Graph Nav</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gripper_camera_param.html">Gripper Camera Params</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/README.html">GPS</a><ul>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/aggregator_client.html">Aggregator Client</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/gps_listener.html">GPS Listener</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/NMEAParser.html">NMEA Parser</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/ntrip_client.html">NTRIP Client</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/registration_client.html">Registration Client</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/image.html">Image</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/image_service_helpers.html">Image Service Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/inverse_kinematics.html">Inverse Kinematics</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/ir_enable_disable.html">IR Enable/Disable</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/keepalive.html">Keep Alive</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/lease.html">Lease</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/lease_resource_hierarchy.html">Lease Resource Hierarchy</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/lease_validator.html">Lease Validator</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/license.html">License</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/local_grid.html">Local Grid</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/log_status.html">Log Status</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/math_helpers.html">Math Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/manipulation_api_client.html">Manipulation API</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/map_processing.html">Map Processing</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/metrics_logging.html">Metrics Logging</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/network_compute_bridge_client.html">Network Compute Bridge</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/payload_registration.html">Payload Registration</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/payload_software_update.html">Payload Software Update</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/payload_software_update_initiation.html">Payload Software Update Initiation</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/payload.html">Payload</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/point_cloud.html">Point Cloud</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/power.html">Power</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/processors.html">Processors</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/ray_cast.html">Ray casting</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/recording.html">Recording</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html">Robot Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/robot_id.html">Robot ID</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/robot.html">Robot</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/robot_state.html">Robot State</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/sdk.html">SDK</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/server_util.html">Server Util</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/service_customization_helpers.html">Service Customization Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/signals_helpers.html">Signals Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/README.html">Spot CAM</a><ul>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/audio.html">Audio</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/compositor.html">Compositor</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/health.html">Health</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/lighting.html">Lighting</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/lights_helper.html">Lights Helper</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/media_log.html">Media Log</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/network.html">Network</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/power.html">Power</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/ptz.html">PTZ</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/streamquality.html">Stream Quality</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/version.html">Version</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_check.html">Spot Check</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/time_sync.html">Time Sync</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/token_cache.html">Token Cache</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/token_manager.html">Token Manager</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/units_helpers.html">Units Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/util.html">Util</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/world_object.html">World Object</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/README.html">Core</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/README.html">BDDF</a><ul>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/base_data_reader.html">Base Data Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/block_writer.html">Block Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/bosdyn.html">BDDF Conventions</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/common.html">Common</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/data_reader.html">Data Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/data_writer.html">Data Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/file_indexer.html">File Indexer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/grpc_proto_reader.html">GRPC Proto Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/grpc_reader.html">GRPC Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/grpc_service_reader.html">GRPC Service Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/grpc_service_writer.html">GRPC Service Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/message_reader.html">Message Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/pod_series_reader.html">POD Series Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/pod_series_writer.html">POD Series Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/protobuf_channel_reader.html">Protobuf Channel Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/protobuf_reader.html">Protobuf Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/protobuf_series_writer.html">Protobuf Series Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/stream_data_reader.html">Stream Data Reader</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/geometry.html">Geometry</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/util.html">Util</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/deprecated.html">Deprecated</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/README.html">Mission</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/client.html">Client</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/constants.html">Constants</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/exceptions.html">Exceptions</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/remote_client.html">Remote Client</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/server_util.html">Server Util</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/util.html">Util</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-choreography-client/src/bosdyn/choreography/client/README.html">Choreography</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-choreography-client/src/bosdyn/choreography/client/choreography.html">Choreography</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-choreography-client/src/bosdyn/choreography/client/animation_file_to_proto.html">Animation File to Proto</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-choreography-client/src/bosdyn/choreography/client/animation_file_conversion_helpers.html">Animation File to Proto Helpers</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-orbit/src/bosdyn/orbit/README.html">Orbit (formerly Scout)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-orbit/src/bosdyn/orbit/client.html">Client</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-orbit/src/bosdyn/orbit/utils.html">Utils</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-orbit/src/bosdyn/orbit/exceptions.html">Exceptions</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-scout/src/bosdyn/scout/README.html">Scout (deprecated)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-scout/src/bosdyn/scout/client.html">Client</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-scout/src/bosdyn/scout/utils.html">Utils</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-scout/src/bosdyn/scout/exceptions.html">Exceptions</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch1.html">Fetch Tutorial</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch2.html">Part 2: Training the Model</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch3.html">Part 3: Evaluating the Model</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch4.html">Part 4: Autonomous Pick Up</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch5.html">Part 5: Detecting People and Playing Fetch</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch6.html">Part 6: Running the model on Core IO</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq1.html">Data Collection Tutorial</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq2.html">Part 2: Capturing images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq3.html">Part 3: Capturing other data</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq4.html">Part 4: Deploying to the CORE I/O</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq5.html">Part 5: Collecting data</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq6.html">Part 6: Processing collected data</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/payload/README.html">Payloads</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/payload_configuration_requirements.html">Payload configuration requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/mechanical_interfaces.html">Mechanical interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/robot_mounting_rails.html">Robot mounting rails</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/guidelines_for_robust_payload_design.html">Guidelines for robust payload design</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/robot_electrical_interface.html">Robot electrical interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/coreio_documentation.html">CORE I/O Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/coreio_openvpn_extension.html">CORE I/O OpenVPN Extension</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/configuring_payload_software.html">Configuring payload software</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/docker_containers.html">Dockerize payload software</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/spot_core_documentation.html">Pre-3.2 Spot CORE Documentation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/payload/spot_core_portainer.html">Configuring Docker containers in SpotCORE</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/payload/spot_core_cockpit.html">Spot CORE system management tool: Cockpit</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/payload/spot_core_vnc.html">Spot CORE VNC</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/protos/README.html">API Protocol</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/protos/style_guide.html">Style Guide</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../protos/bosdyn/api/README.html">Proto Reference Guide</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../protos/bosdyn/api/proto_reference.html">Protos</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/release_notes.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/boston-dynamics/spot-sdk">SDK Repository</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../README.html">Spot</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../README.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../index.html">Module code</a></li>
      <li class="breadcrumb-item active">bosdyn.client.robot_command</li>
      <li class="wy-breadcrumbs-aside">
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <h1>Source code for bosdyn.client.robot_command</h1><div class="highlight"><pre>
<span></span><span class="c1"># Copyright (c) 2023 Boston Dynamics, Inc.  All rights reserved.</span>
<span class="c1">#</span>
<span class="c1"># Downloading, reproducing, distributing or otherwise using the SDK Software</span>
<span class="c1"># is subject to the terms and conditions of the Boston Dynamics Software</span>
<span class="c1"># Development Kit License (20191101-BDSDK-SL).</span>

<span class="sd">&quot;&quot;&quot;For clients to the robot command service.&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">collections</span>
<span class="kn">import</span> <span class="nn">time</span>

<span class="kn">from</span> <span class="nn">google.protobuf</span> <span class="kn">import</span> <span class="n">any_pb2</span><span class="p">,</span> <span class="n">wrappers_pb2</span>

<span class="kn">from</span> <span class="nn">bosdyn</span> <span class="kn">import</span> <span class="n">geometry</span>
<span class="kn">from</span> <span class="nn">bosdyn.api</span> <span class="kn">import</span> <span class="p">(</span><span class="n">arm_command_pb2</span><span class="p">,</span> <span class="n">basic_command_pb2</span><span class="p">,</span> <span class="n">full_body_command_pb2</span><span class="p">,</span> <span class="n">geometry_pb2</span><span class="p">,</span>
                        <span class="n">gripper_command_pb2</span><span class="p">,</span> <span class="n">mobility_command_pb2</span><span class="p">,</span> <span class="n">payload_estimation_pb2</span><span class="p">,</span>
                        <span class="n">robot_command_pb2</span><span class="p">,</span> <span class="n">robot_command_service_pb2_grpc</span><span class="p">,</span> <span class="n">synchronized_command_pb2</span><span class="p">,</span>
                        <span class="n">trajectory_pb2</span><span class="p">)</span>

<span class="c1"># isort: off</span>
<span class="c1"># isort: on</span>
<span class="kn">from</span> <span class="nn">bosdyn.api.spot</span> <span class="kn">import</span> <span class="n">robot_command_pb2</span> <span class="k">as</span> <span class="n">spot_command_pb2</span>
<span class="kn">from</span> <span class="nn">bosdyn.client.common</span> <span class="kn">import</span> <span class="p">(</span><span class="n">BaseClient</span><span class="p">,</span> <span class="n">error_factory</span><span class="p">,</span> <span class="n">error_pair</span><span class="p">,</span>
                                  <span class="n">handle_common_header_errors</span><span class="p">,</span> <span class="n">handle_lease_use_result_errors</span><span class="p">,</span>
                                  <span class="n">handle_unset_status_error</span><span class="p">)</span>
<span class="kn">from</span> <span class="nn">bosdyn.util</span> <span class="kn">import</span> <span class="n">seconds_to_duration</span>

<span class="kn">from</span> <span class="nn">.exceptions</span> <span class="kn">import</span> <span class="n">Error</span> <span class="k">as</span> <span class="n">BaseError</span>
<span class="kn">from</span> <span class="nn">.exceptions</span> <span class="kn">import</span> <span class="n">InvalidRequestError</span><span class="p">,</span> <span class="n">ResponseError</span><span class="p">,</span> <span class="n">TimedOutError</span><span class="p">,</span> <span class="n">UnsetStatusError</span>
<span class="kn">from</span> <span class="nn">.frame_helpers</span> <span class="kn">import</span> <span class="n">BODY_FRAME_NAME</span><span class="p">,</span> <span class="n">ODOM_FRAME_NAME</span><span class="p">,</span> <span class="n">get_se2_a_tform_b</span>
<span class="kn">from</span> <span class="nn">.lease</span> <span class="kn">import</span> <span class="n">add_lease_wallet_processors</span>
<span class="kn">from</span> <span class="nn">.math_helpers</span> <span class="kn">import</span> <span class="n">SE2Pose</span><span class="p">,</span> <span class="n">SE3Pose</span><span class="p">,</span> <span class="n">SE3Velocity</span>

<span class="c1"># The angles (in radians) that represent the claw gripper open and closed positions.</span>
<span class="n">_CLAW_GRIPPER_OPEN_ANGLE</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1.5708</span>
<span class="n">_CLAW_GRIPPER_CLOSED_ANGLE</span> <span class="o">=</span> <span class="mi">0</span>


<div class="viewcode-block" id="RobotCommandResponseError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandResponseError">[docs]</a><span class="k">class</span> <span class="nc">RobotCommandResponseError</span><span class="p">(</span><span class="n">ResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;General class of errors for RobotCommand service.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="Error"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.Error">[docs]</a><span class="k">class</span> <span class="nc">Error</span><span class="p">(</span><span class="n">BaseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Base class for non-response errors in this module.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="NoTimeSyncError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.NoTimeSyncError">[docs]</a><span class="k">class</span> <span class="nc">NoTimeSyncError</span><span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Client has not done timesync with robot.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="ExpiredError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.ExpiredError">[docs]</a><span class="k">class</span> <span class="nc">ExpiredError</span><span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;The command was received after its max_duration had already passed.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="TooDistantError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.TooDistantError">[docs]</a><span class="k">class</span> <span class="nc">TooDistantError</span><span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;The command end time was too far in the future.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="NotPoweredOnError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.NotPoweredOnError">[docs]</a><span class="k">class</span> <span class="nc">NotPoweredOnError</span><span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;The robot must be powered on to accept a command.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="BehaviorFaultError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.BehaviorFaultError">[docs]</a><span class="k">class</span> <span class="nc">BehaviorFaultError</span><span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;The robot may not be commanded with uncleared behavior faults.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="DockedError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.DockedError">[docs]</a><span class="k">class</span> <span class="nc">DockedError</span><span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;The command cannot be executed while the robot is docked.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="NotClearedError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.NotClearedError">[docs]</a><span class="k">class</span> <span class="nc">NotClearedError</span><span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Behavior fault could not be cleared.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="UnsupportedError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.UnsupportedError">[docs]</a><span class="k">class</span> <span class="nc">UnsupportedError</span><span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;The API supports this request, but the system does not support this request.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="CommandFailedError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.CommandFailedError">[docs]</a><span class="k">class</span> <span class="nc">CommandFailedError</span><span class="p">(</span><span class="n">Error</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Command indicated it failed in its feedback.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="CommandFailedErrorWithFeedback"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.CommandFailedErrorWithFeedback">[docs]</a><span class="k">class</span> <span class="nc">CommandFailedErrorWithFeedback</span><span class="p">(</span><span class="n">CommandFailedError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Command indicated it failed in its feedback.</span>
<span class="sd">    This subclass contains the feedback response causing the error.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">message</span><span class="p">,</span> <span class="n">feedback</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">message</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">feedback</span> <span class="o">=</span> <span class="n">feedback</span></div>


<div class="viewcode-block" id="CommandTimedOutError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.CommandTimedOutError">[docs]</a><span class="k">class</span> <span class="nc">CommandTimedOutError</span><span class="p">(</span><span class="n">Error</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Timed out waiting for SUCCESS response from robot command.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="UnknownFrameError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.UnknownFrameError">[docs]</a><span class="k">class</span> <span class="nc">UnknownFrameError</span><span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Robot does not know how to handle supplied frame.&quot;&quot;&quot;</span></div>


<span class="k">class</span> <span class="nc">_TimeConverter</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Constructs a RobotTimeConverter as necessary.</span>

<span class="sd">    Args:</span>
<span class="sd">        parent: Parent for the time sync endpoint.</span>
<span class="sd">        endpoint: Endpoint for the time converted.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_parent</span> <span class="o">=</span> <span class="n">parent</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span> <span class="o">=</span> <span class="n">endpoint</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_converter</span> <span class="o">=</span> <span class="kc">None</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">obj</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Accessor which lazily constructs the RobotTimeConverter.&quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_converter</span><span class="p">:</span>
            <span class="n">endpoint</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parent</span><span class="o">.</span><span class="n">timesync_endpoint</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_converter</span> <span class="o">=</span> <span class="n">endpoint</span><span class="o">.</span><span class="n">get_robot_time_converter</span><span class="p">()</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_converter</span>

    <span class="k">def</span> <span class="nf">convert_timestamp_from_local_to_robot</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">timestamp</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Calls RobotTimeConverter.convert_timestamp_from_local_to_robot().</span>

<span class="sd">        Args:</span>
<span class="sd">            timestamp: Timestamp to convert.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">convert_timestamp_from_local_to_robot</span><span class="p">(</span><span class="n">timestamp</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">robot_timestamp_from_local_secs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">end_time_secs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Calls RobotTimeConverter.robot_timestamp_from_local_secs().</span>

<span class="sd">        Args:</span>
<span class="sd">            end_time_secs: Time in seconds to convert.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">robot_timestamp_from_local_secs</span><span class="p">(</span><span class="n">end_time_secs</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">local_seconds_from_robot_timestamp</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">robot_timestamp</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Calls RobotTimeConverter.local_seconds_from_robot_timestamp().</span>

<span class="sd">        Args:</span>
<span class="sd">          local_time_secs:  Local system time, in seconds from the unix epoch.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">local_seconds_from_robot_timestamp</span><span class="p">(</span><span class="n">robot_timestamp</span><span class="p">)</span>


<span class="c1"># Tree of proto-fields leading to end_time fields needing to be set from end_time_secs.</span>
<span class="n">END_TIME_EDIT_TREE</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;synchronized_command&#39;</span><span class="p">:</span> <span class="p">{</span>
        <span class="s1">&#39;mobility_command&#39;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s1">&#39;@command&#39;</span><span class="p">:</span> <span class="p">{</span>  <span class="c1"># &#39;command&#39; is a oneof submessage</span>
                <span class="s1">&#39;se2_velocity_request&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;end_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                <span class="p">},</span>
                <span class="s1">&#39;se2_trajectory_request&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;end_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                <span class="p">},</span>
                <span class="s1">&#39;stance_request&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;end_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="s1">&#39;arm_command&#39;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s1">&#39;@command&#39;</span><span class="p">:</span> <span class="p">{</span>  <span class="c1"># &#39;command&#39; is a oneof submessage</span>
                <span class="s1">&#39;arm_velocity_command&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;end_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">}</span>

<span class="c1"># Tree of proto fields leading to Timestamp protos which need to be converted from</span>
<span class="c1">#  client clock to robot clock values using timesync information from the robot.</span>
<span class="c1"># Note, the &quot;@&quot; sign indicates a oneof field. The &quot;None&quot; indicates the field which</span>
<span class="c1"># contains the timestamp to be updated.</span>
<span class="n">EDIT_TREE_CONVERT_LOCAL_TIME_TO_ROBOT_TIME</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;synchronized_command&#39;</span><span class="p">:</span> <span class="p">{</span>
        <span class="s1">&#39;mobility_command&#39;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s1">&#39;@command&#39;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s1">&#39;se2_trajectory_request&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;trajectory&#39;</span><span class="p">:</span> <span class="p">{</span>
                        <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                    <span class="p">}</span>
                <span class="p">},</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="s1">&#39;gripper_command&#39;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s1">&#39;@command&#39;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s1">&#39;claw_gripper_command&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;trajectory&#39;</span><span class="p">:</span> <span class="p">{</span>
                        <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="s1">&#39;arm_command&#39;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s1">&#39;@command&#39;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s1">&#39;arm_cartesian_command&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;pose_trajectory_in_task&#39;</span><span class="p">:</span> <span class="p">{</span>
                        <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                    <span class="p">},</span>
                    <span class="s1">&#39;wrench_trajectory_in_task&#39;</span><span class="p">:</span> <span class="p">{</span>
                        <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                    <span class="p">}</span>
                <span class="p">},</span>
                <span class="s1">&#39;arm_joint_move_command&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;trajectory&#39;</span><span class="p">:</span> <span class="p">{</span>
                        <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                    <span class="p">}</span>
                <span class="p">},</span>
                <span class="s1">&#39;arm_gaze_command&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;target_trajectory_in_frame1&#39;</span><span class="p">:</span> <span class="p">{</span>
                        <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                    <span class="p">},</span>
                    <span class="s1">&#39;tool_trajectory_in_frame2&#39;</span><span class="p">:</span> <span class="p">{</span>
                        <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                    <span class="p">}</span>
                <span class="p">},</span>
                <span class="s1">&#39;arm_impedance_command&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;task_tform_desired_tool&#39;</span><span class="p">:</span> <span class="p">{</span>
                        <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                    <span class="p">},</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">}</span>

<span class="c1"># Tree of proto fields leading to Timestamp protos which need to be converted from</span>
<span class="c1">#  client clock to robot clock values using timesync information from the robot.</span>
<span class="c1"># Note, the &quot;@&quot; sign indicates a oneof field. The &quot;None&quot; indicates the field which</span>
<span class="c1"># contains the timestamp to be updated.</span>
<span class="n">MOBILITY_PARAM_TREE_CONVERT_LOCAL_TIME_TO_ROBOT_TIME</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;body_control&#39;</span><span class="p">:</span> <span class="p">{</span>
        <span class="s1">&#39;@param&#39;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s1">&#39;base_offset_rt_footprint&#39;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
            <span class="p">},</span>
            <span class="s1">&#39;body_pose&#39;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s1">&#39;base_offset_rt_root&#39;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s1">&#39;reference_time&#39;</span><span class="p">:</span> <span class="kc">None</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">}</span>


<span class="k">def</span> <span class="nf">_edit_proto</span><span class="p">(</span><span class="n">proto</span><span class="p">,</span> <span class="n">edit_tree</span><span class="p">,</span> <span class="n">edit_fn</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Recursion to update specified fields of a protobuf using a specified edit-function.</span>

<span class="sd">    Args:</span>
<span class="sd">        proto: Protobuf to edit recursively.</span>
<span class="sd">        edit_tree: Part of the tree to edit.</span>
<span class="sd">        edit_fn: Edit function to execute.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">subtree</span> <span class="ow">in</span> <span class="n">edit_tree</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
        <span class="k">if</span> <span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">&#39;@&#39;</span><span class="p">):</span>
            <span class="c1"># Recursion into a one-of message. &#39;@key&#39; means field &#39;key&#39; contains a one-of message.</span>
            <span class="n">which_oneof</span> <span class="o">=</span> <span class="n">proto</span><span class="o">.</span><span class="n">WhichOneof</span><span class="p">(</span><span class="n">key</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>
            <span class="k">if</span> <span class="ow">not</span> <span class="n">which_oneof</span> <span class="ow">or</span> <span class="n">which_oneof</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">subtree</span><span class="p">:</span>
                <span class="c1"># No submessage, or tree doesn&#39;t contain a conversion for it.</span>
                <span class="k">return</span>
            <span class="n">_edit_proto</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">proto</span><span class="p">,</span> <span class="n">which_oneof</span><span class="p">),</span> <span class="n">subtree</span><span class="p">[</span><span class="n">which_oneof</span><span class="p">],</span> <span class="n">edit_fn</span><span class="p">)</span>
        <span class="k">elif</span> <span class="n">subtree</span><span class="p">:</span>
            <span class="c1"># Recursion into a sub-message by field name.</span>
            <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">proto</span><span class="o">.</span><span class="n">DESCRIPTOR</span><span class="o">.</span><span class="n">fields_by_name</span> <span class="ow">and</span> <span class="n">proto</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="n">key</span><span class="p">):</span>
                <span class="n">subproto</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">proto</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span>
                <span class="n">_edit_proto</span><span class="p">(</span><span class="n">subproto</span><span class="p">,</span> <span class="n">subtree</span><span class="p">,</span> <span class="n">edit_fn</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="c1"># At a leaf node of the edit_tree.  Edit the proto using the supplied function.</span>
            <span class="n">edit_fn</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">proto</span><span class="p">)</span>


<div class="viewcode-block" id="RobotCommandClient"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandClient">[docs]</a><span class="k">class</span> <span class="nc">RobotCommandClient</span><span class="p">(</span><span class="n">BaseClient</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Client for calling RobotCommand services.&quot;&quot;&quot;</span>
    <span class="n">default_service_name</span> <span class="o">=</span> <span class="s1">&#39;robot-command&#39;</span>
    <span class="n">service_type</span> <span class="o">=</span> <span class="s1">&#39;bosdyn.api.RobotCommandService&#39;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">RobotCommandClient</span><span class="p">,</span>
              <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">robot_command_service_pb2_grpc</span><span class="o">.</span><span class="n">RobotCommandServiceStub</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_timesync_endpoint</span> <span class="o">=</span> <span class="kc">None</span>

<div class="viewcode-block" id="RobotCommandClient.update_from"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandClient.update_from">[docs]</a>    <span class="k">def</span> <span class="nf">update_from</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Update instance from another object.</span>

<span class="sd">        Args:</span>
<span class="sd">            other: The object where to copy from.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">RobotCommandClient</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">update_from</span><span class="p">(</span><span class="n">other</span><span class="p">)</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">lease_wallet</span><span class="p">:</span>
            <span class="n">add_lease_wallet_processors</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">lease_wallet</span><span class="p">)</span>

        <span class="c1"># Grab a timesync endpoint if it is available.</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_timesync_endpoint</span> <span class="o">=</span> <span class="n">other</span><span class="o">.</span><span class="n">time_sync</span><span class="o">.</span><span class="n">endpoint</span>
        <span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
            <span class="k">pass</span>  <span class="c1"># other doesn&#39;t have a time_sync accessor</span></div>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">timesync_endpoint</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Accessor for timesync-endpoint that was grabbed via &#39;update_from()&#39;.&quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_timesync_endpoint</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NoTimeSyncError</span><span class="p">(</span>
                <span class="n">response</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                <span class="n">error_message</span><span class="o">=</span><span class="s2">&quot;No timesync endpoint was passed to robot command client.&quot;</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_timesync_endpoint</span>

<div class="viewcode-block" id="RobotCommandClient.robot_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandClient.robot_command">[docs]</a>    <span class="k">def</span> <span class="nf">robot_command</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">command</span><span class="p">,</span> <span class="n">end_time_secs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">timesync_endpoint</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">lease</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                      <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Issue a command to the robot synchronously.</span>

<span class="sd">        Args:</span>
<span class="sd">            command: Command to issue.</span>
<span class="sd">            end_time_secs: End time for the command in seconds.</span>
<span class="sd">            timesync_endpoint: Timesync endpoint.</span>
<span class="sd">            lease: Lease object to use for the command.</span>

<span class="sd">        Returns:</span>
<span class="sd">            ID of the issued robot command.</span>

<span class="sd">        Raises:</span>
<span class="sd">            RpcError: Problem communicating with the robot.</span>
<span class="sd">            bosdyn.client.exceptions.InvalidRequestError: Invalid request received by the robot.</span>
<span class="sd">            UnsupportedError: The API supports this request, but the system does not support this</span>
<span class="sd">                              request.</span>
<span class="sd">            bosdyn.client.robot_command.NoTimeSyncError: Client has not done timesync with robot.</span>
<span class="sd">            ExpiredError: The command was received after its max_duration had already passed.</span>
<span class="sd">            bosdyn.client.robot_command.TooDistantError: The command end time was too far in the future.</span>
<span class="sd">            NotPoweredOnError: The robot must be powered on to accept a command.</span>
<span class="sd">            BehaviorFaultError: The robot is faulted and the fault must be cleared first.</span>
<span class="sd">            DockedError: The command cannot be executed while the robot is docked.</span>
<span class="sd">            bosdyn.client.robot_command.UnknownFrameError: Robot does not know how to handle supplied frame.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_robot_command_request</span><span class="p">(</span><span class="n">lease</span><span class="p">,</span> <span class="n">command</span><span class="p">)</span>
        <span class="c1"># Update req.command instead of command so that we don&#39;t modify an input in this function.</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_update_command_timestamps</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">command</span><span class="p">,</span> <span class="n">end_time_secs</span><span class="p">,</span> <span class="n">timesync_endpoint</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">_robot_command_value</span><span class="p">,</span> <span class="n">_robot_command_error</span><span class="p">,</span>
                         <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandClient.robot_command_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandClient.robot_command_async">[docs]</a>    <span class="k">def</span> <span class="nf">robot_command_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">command</span><span class="p">,</span> <span class="n">end_time_secs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">timesync_endpoint</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">lease</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                            <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of robot_command().</span>

<span class="sd">        Args:</span>
<span class="sd">            command: Command to issue.</span>
<span class="sd">            end_time_secs: End time for the command in seconds.</span>
<span class="sd">            timesync_endpoint: Timesync endpoint.</span>
<span class="sd">            lease: Lease object to use for the command.</span>

<span class="sd">        Returns:</span>
<span class="sd">            ID of the issued robot command.</span>

<span class="sd">        Raises:</span>
<span class="sd">            RpcError: Problem communicating with the robot.</span>
<span class="sd">            bosdyn.client.exceptions.InvalidRequestError: Invalid request received by the robot.</span>
<span class="sd">            UnsupportedError: The API supports this request, but the system does not support this</span>
<span class="sd">                              request.</span>
<span class="sd">            bosdyn.client.robot_command.NoTimeSyncError: Client has not done timesync with robot.</span>
<span class="sd">            ExpiredError: The command was received after its max_duration had already passed.</span>
<span class="sd">            bosdyn.client.robot_command.TooDistantError: The command end time was too far in the future.</span>
<span class="sd">            NotPoweredOnError: The robot must be powered on to accept a command.</span>
<span class="sd">            bosdyn.client.robot_command.UnknownFrameError: Robot does not know how to handle supplied frame.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_robot_command_request</span><span class="p">(</span><span class="n">lease</span><span class="p">,</span> <span class="n">command</span><span class="p">)</span>
        <span class="c1"># Update req.command instead of command so that we don&#39;t modify an input to this function.</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_update_command_timestamps</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">command</span><span class="p">,</span> <span class="n">end_time_secs</span><span class="p">,</span> <span class="n">timesync_endpoint</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">_robot_command_value</span><span class="p">,</span>
                               <span class="n">_robot_command_error</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandClient.robot_command_feedback"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandClient.robot_command_feedback">[docs]</a>    <span class="k">def</span> <span class="nf">robot_command_feedback</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">robot_command_id</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Get feedback from a previously issued command.</span>

<span class="sd">        Args:</span>
<span class="sd">            robot_command_id: ID of the robot command to get feedback on.</span>

<span class="sd">        Raises:</span>
<span class="sd">            RpcError: Problem communicating with the robot.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_robot_command_feedback_request</span><span class="p">(</span><span class="n">robot_command_id</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">RobotCommandFeedback</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="n">_robot_command_feedback_error</span><span class="p">,</span>
                         <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandClient.robot_command_feedback_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandClient.robot_command_feedback_async">[docs]</a>    <span class="k">def</span> <span class="nf">robot_command_feedback_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">robot_command_id</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of robot_command_feedback().</span>

<span class="sd">        Args:</span>
<span class="sd">            robot_command_id: ID of the robot command to get feedback on.</span>

<span class="sd">        Raises:</span>
<span class="sd">            RpcError: Problem communicating with the robot.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_robot_command_feedback_request</span><span class="p">(</span><span class="n">robot_command_id</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">RobotCommandFeedback</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span>
                               <span class="n">_robot_command_feedback_error</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>


<div class="viewcode-block" id="RobotCommandClient.clear_behavior_fault"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandClient.clear_behavior_fault">[docs]</a>    <span class="k">def</span> <span class="nf">clear_behavior_fault</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">behavior_fault_id</span><span class="p">,</span> <span class="n">lease</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Clear a behavior fault on the robot.</span>

<span class="sd">        Args:</span>
<span class="sd">            behavior_fault_id: ID of the behavior fault.</span>
<span class="sd">            lease: Lease information to use in the message.</span>

<span class="sd">        Returns:</span>
<span class="sd">            Boolean whether response status is STATUS_CLEARED.</span>

<span class="sd">        Raises:</span>
<span class="sd">            RpcError: Problem communicating with the robot.</span>
<span class="sd">            NotClearedError: Behavior fault could not be cleared.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_clear_behavior_fault_request</span><span class="p">(</span><span class="n">lease</span><span class="p">,</span> <span class="n">behavior_fault_id</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">ClearBehaviorFault</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">_clear_behavior_fault_value</span><span class="p">,</span>
                         <span class="n">_clear_behavior_fault_error</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandClient.clear_behavior_fault_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandClient.clear_behavior_fault_async">[docs]</a>    <span class="k">def</span> <span class="nf">clear_behavior_fault_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">behavior_fault_id</span><span class="p">,</span> <span class="n">lease</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of clear_behavior_fault().</span>

<span class="sd">        Args:</span>
<span class="sd">            behavior_fault_id:</span>
<span class="sd">            lease:</span>
<span class="sd">            behavior_fault_id: ID of the behavior fault.</span>
<span class="sd">            lease: Lease information to use in the message.</span>

<span class="sd">        Returns:</span>
<span class="sd">            Boolean whether response status is STATUS_CLEARED.</span>

<span class="sd">        Raises:</span>
<span class="sd">            RpcError: Problem communicating with the robot.</span>
<span class="sd">            NotClearedError: Behavior fault could not be cleared.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_clear_behavior_fault_request</span><span class="p">(</span><span class="n">lease</span><span class="p">,</span> <span class="n">behavior_fault_id</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">ClearBehaviorFault</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">_clear_behavior_fault_value</span><span class="p">,</span>
                               <span class="n">_clear_behavior_fault_error</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

    <span class="k">def</span> <span class="nf">_get_robot_command_request</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">lease</span><span class="p">,</span> <span class="n">command</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Create RobotCommandRequest message from the given information.</span>

<span class="sd">        Args:</span>
<span class="sd">            lease: Lease to use for the command.</span>
<span class="sd">            command: Command to specify in the request message.</span>

<span class="sd">        Returns:</span>
<span class="sd">            Filled out RobotCommandRequest message.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="k">return</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandRequest</span><span class="p">(</span>
            <span class="n">lease</span><span class="o">=</span><span class="n">lease</span><span class="p">,</span> <span class="n">command</span><span class="o">=</span><span class="n">command</span><span class="p">,</span> <span class="n">clock_identifier</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">timesync_endpoint</span><span class="o">.</span><span class="n">clock_identifier</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">_update_command_timestamps</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">command</span><span class="p">,</span> <span class="n">end_time_secs</span><span class="p">,</span> <span class="n">timesync_endpoint</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Set or convert fields of the command proto that need timestamps in the robot&#39;s clock.</span>

<span class="sd">        Args:</span>
<span class="sd">            command: Command message to update.</span>
<span class="sd">            end_time_secs: Command end time in seconds.</span>
<span class="sd">            timesync_endpoint: Timesync endpoint.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="c1"># Lazy RobotTimeConverter: initialized only if needed to make a conversion.</span>
        <span class="n">converter</span> <span class="o">=</span> <span class="n">_TimeConverter</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">timesync_endpoint</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">_set_end_time</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">proto</span><span class="p">):</span>
<span class="w">            </span><span class="sd">&quot;&quot;&quot;If proto has a field named key, fill set it to end_time_secs as robot time. &quot;&quot;&quot;</span>
            <span class="k">if</span> <span class="n">key</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">proto</span><span class="o">.</span><span class="n">DESCRIPTOR</span><span class="o">.</span><span class="n">fields_by_name</span><span class="p">:</span>
                <span class="k">return</span>  <span class="c1"># No such field in the proto to be set to the end-time.</span>
            <span class="n">end_time</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">proto</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span>
            <span class="n">end_time</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">converter</span><span class="o">.</span><span class="n">robot_timestamp_from_local_secs</span><span class="p">(</span><span class="n">end_time_secs</span><span class="p">))</span>

        <span class="k">def</span> <span class="nf">_to_robot_time</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">proto</span><span class="p">):</span>
<span class="w">            </span><span class="sd">&quot;&quot;&quot;If proto has a field named key with a timestamp, convert timestamp to robot time.&quot;&quot;&quot;</span>
            <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">key</span> <span class="ow">in</span> <span class="n">proto</span><span class="o">.</span><span class="n">DESCRIPTOR</span><span class="o">.</span><span class="n">fields_by_name</span> <span class="ow">and</span> <span class="n">proto</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="n">key</span><span class="p">)):</span>
                <span class="c1"># No such field in proto, or field does not contain a timestamp.</span>
                <span class="k">return</span>
            <span class="n">timestamp</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">proto</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span>
            <span class="n">converter</span><span class="o">.</span><span class="n">convert_timestamp_from_local_to_robot</span><span class="p">(</span><span class="n">timestamp</span><span class="p">)</span>

        <span class="c1"># Set fields needing to be set from end_time_secs.</span>
        <span class="k">if</span> <span class="n">end_time_secs</span><span class="p">:</span>
            <span class="n">_edit_proto</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">END_TIME_EDIT_TREE</span><span class="p">,</span> <span class="n">_set_end_time</span><span class="p">)</span>

        <span class="c1"># Convert timestamps from local time to robot time.</span>
        <span class="n">_edit_proto</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">EDIT_TREE_CONVERT_LOCAL_TIME_TO_ROBOT_TIME</span><span class="p">,</span> <span class="n">_to_robot_time</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">command</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">mobility_command</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;params&quot;</span><span class="p">):</span>
            <span class="n">params</span> <span class="o">=</span> <span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">MobilityParams</span><span class="p">()</span>
            <span class="n">command</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">mobility_command</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">Unpack</span><span class="p">(</span><span class="n">params</span><span class="p">)</span>
            <span class="n">_edit_proto</span><span class="p">(</span><span class="n">params</span><span class="p">,</span> <span class="n">MOBILITY_PARAM_TREE_CONVERT_LOCAL_TIME_TO_ROBOT_TIME</span><span class="p">,</span>
                        <span class="n">_to_robot_time</span><span class="p">)</span>
            <span class="n">command</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">mobility_command</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">Pack</span><span class="p">(</span><span class="n">params</span><span class="p">)</span>

    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">_get_robot_command_feedback_request</span><span class="p">(</span><span class="n">robot_command_id</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Create RobotCommandFeedbackRequest message with the given command id.</span>

<span class="sd">        Args:</span>
<span class="sd">            robot_command_id: Command id to specify in the request message.</span>

<span class="sd">        Returns:</span>
<span class="sd">            Filled out RobotCommandFeedbackRequest message.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandFeedbackRequest</span><span class="p">(</span><span class="n">robot_command_id</span><span class="o">=</span><span class="n">robot_command_id</span><span class="p">)</span>

    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">_get_clear_behavior_fault_request</span><span class="p">(</span><span class="n">lease</span><span class="p">,</span> <span class="n">behavior_fault_id</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Create ClearBehaviorFaultRequest message with the given information.</span>

<span class="sd">        Args:</span>
<span class="sd">            lease: Lease information to use in the request.</span>
<span class="sd">            behavior_fault_id: Fault id to specify in the request message.</span>

<span class="sd">        Returns:</span>
<span class="sd">            Filled out ClearBehaviorFaultRequest message.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">ClearBehaviorFaultRequest</span><span class="p">(</span><span class="n">lease</span><span class="o">=</span><span class="n">lease</span><span class="p">,</span>
                                                           <span class="n">behavior_fault_id</span><span class="o">=</span><span class="n">behavior_fault_id</span><span class="p">)</span></div>


<div class="viewcode-block" id="RobotCommandStreamingClient"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandStreamingClient">[docs]</a><span class="k">class</span> <span class="nc">RobotCommandStreamingClient</span><span class="p">(</span><span class="n">BaseClient</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Client for calling RobotCommand services.</span>

<span class="sd">    This client is in BETA and may undergo changes in future releases.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="n">default_service_name</span> <span class="o">=</span> <span class="s1">&#39;robot-command-streaming&#39;</span>
    <span class="n">service_type</span> <span class="o">=</span> <span class="s1">&#39;bosdyn.api.RobotCommandStreamingService&#39;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">RobotCommandStreamingClient</span><span class="p">,</span>
              <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">robot_command_service_pb2_grpc</span><span class="o">.</span><span class="n">RobotCommandStreamingServiceStub</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_timesync_endpoint</span> <span class="o">=</span> <span class="kc">None</span>

<div class="viewcode-block" id="RobotCommandStreamingClient.send_joint_control_commands"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandStreamingClient.send_joint_control_commands">[docs]</a>    <span class="k">def</span> <span class="nf">send_joint_control_commands</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">command_iterator</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">JointControlStream</span><span class="p">(</span><span class="n">command_iterator</span><span class="p">)</span></div></div>


<span class="k">def</span> <span class="nf">_robot_command_value</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Get the command id from a RobotCommandResponse.</span>

<span class="sd">    Args:</span>
<span class="sd">        response: RobotCommandResponse message.</span>

<span class="sd">    Returns:</span>
<span class="sd">        Robot Command id in the response message.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">robot_command_id</span>


<span class="c1"># yapf: disable</span>
<span class="n">_ROBOT_COMMAND_STATUS_TO_ERROR</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">defaultdict</span><span class="p">(</span>
    <span class="k">lambda</span><span class="p">:</span> <span class="p">(</span><span class="n">RobotCommandResponseError</span><span class="p">,</span> <span class="kc">None</span><span class="p">))</span>
<span class="n">_ROBOT_COMMAND_STATUS_TO_ERROR</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_OK</span><span class="p">:</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_INVALID_REQUEST</span><span class="p">:</span> <span class="n">error_pair</span><span class="p">(</span><span class="n">InvalidRequestError</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_UNSUPPORTED</span><span class="p">:</span> <span class="n">error_pair</span><span class="p">(</span><span class="n">UnsupportedError</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_NO_TIMESYNC</span><span class="p">:</span> <span class="n">error_pair</span><span class="p">(</span><span class="n">NoTimeSyncError</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_EXPIRED</span><span class="p">:</span> <span class="n">error_pair</span><span class="p">(</span><span class="n">ExpiredError</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_TOO_DISTANT</span><span class="p">:</span> <span class="n">error_pair</span><span class="p">(</span><span class="n">TooDistantError</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_NOT_POWERED_ON</span><span class="p">:</span> <span class="n">error_pair</span><span class="p">(</span><span class="n">NotPoweredOnError</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_BEHAVIOR_FAULT</span><span class="p">:</span> <span class="n">error_pair</span><span class="p">(</span><span class="n">BehaviorFaultError</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_DOCKED</span><span class="p">:</span> <span class="n">error_pair</span><span class="p">(</span><span class="n">DockedError</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">STATUS_UNKNOWN_FRAME</span><span class="p">:</span> <span class="n">error_pair</span><span class="p">(</span><span class="n">UnknownFrameError</span><span class="p">),</span>
<span class="p">})</span>
<span class="c1"># yapf: enable</span>


<span class="nd">@handle_common_header_errors</span>
<span class="nd">@handle_lease_use_result_errors</span>
<span class="nd">@handle_unset_status_error</span><span class="p">(</span><span class="n">unset</span><span class="o">=</span><span class="s1">&#39;STATUS_UNKNOWN&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_robot_command_error</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Return a custom exception based on response, None if no error.</span>

<span class="sd">    Args:</span>
<span class="sd">        response: Response message to get the status from.</span>

<span class="sd">    Returns:</span>
<span class="sd">        None if status_to_error[status] maps to (None, _).</span>
<span class="sd">        Otherwise, an instance of an error determined by status_to_error.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="k">return</span> <span class="n">error_factory</span><span class="p">(</span><span class="n">response</span><span class="p">,</span> <span class="n">response</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
                         <span class="n">status_to_string</span><span class="o">=</span><span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommandResponse</span><span class="o">.</span><span class="n">Status</span><span class="o">.</span><span class="n">Name</span><span class="p">,</span>
                         <span class="n">status_to_error</span><span class="o">=</span><span class="n">_ROBOT_COMMAND_STATUS_TO_ERROR</span><span class="p">)</span>


<span class="nd">@handle_common_header_errors</span>
<span class="k">def</span> <span class="nf">_robot_command_feedback_error</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
    <span class="c1"># Write custom handling unset errors here. Only one of these statuses needs to be set.</span>
    <span class="n">field</span> <span class="o">=</span> <span class="s1">&#39;status&#39;</span>
    <span class="k">if</span> <span class="p">((</span><span class="nb">getattr</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">full_body_feedback</span><span class="p">,</span> <span class="n">field</span><span class="p">))</span> <span class="ow">or</span>
        <span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span><span class="o">.</span><span class="n">mobility_command_feedback</span><span class="p">,</span> <span class="n">field</span><span class="p">))</span> <span class="ow">or</span>
        <span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span><span class="o">.</span><span class="n">arm_command_feedback</span><span class="p">,</span> <span class="n">field</span><span class="p">))</span> <span class="ow">or</span>
        <span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span><span class="o">.</span><span class="n">gripper_command_feedback</span><span class="p">,</span> <span class="n">field</span><span class="p">))):</span>
        <span class="k">return</span> <span class="kc">None</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="k">return</span> <span class="n">UnsetStatusError</span><span class="p">(</span><span class="n">response</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">_clear_behavior_fault_value</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Check if ClearBehaviorFault message status is STATUS_CLEARED.</span>

<span class="sd">    Args:</span>
<span class="sd">        response: Response message to check.</span>

<span class="sd">    Returns:</span>
<span class="sd">        Boolean whether status in response message is STATUS_CLEARED.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">ClearBehaviorFaultResponse</span><span class="o">.</span><span class="n">STATUS_CLEARED</span>


<span class="c1"># yapf: disable</span>
<span class="n">_CLEAR_BEHAVIOR_FAULT_STATUS_TO_ERROR</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">defaultdict</span><span class="p">(</span>
    <span class="k">lambda</span><span class="p">:</span> <span class="p">(</span><span class="n">ResponseError</span><span class="p">,</span> <span class="kc">None</span><span class="p">))</span>
<span class="n">_CLEAR_BEHAVIOR_FAULT_STATUS_TO_ERROR</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">ClearBehaviorFaultResponse</span><span class="o">.</span><span class="n">STATUS_CLEARED</span><span class="p">:</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
    <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">ClearBehaviorFaultResponse</span><span class="o">.</span><span class="n">STATUS_NOT_CLEARED</span><span class="p">:</span>
        <span class="p">(</span><span class="n">NotClearedError</span><span class="p">,</span> <span class="n">NotClearedError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
<span class="p">})</span>
<span class="c1"># yapf: enable</span>


<span class="nd">@handle_common_header_errors</span>
<span class="nd">@handle_lease_use_result_errors</span>
<span class="nd">@handle_unset_status_error</span><span class="p">(</span><span class="n">unset</span><span class="o">=</span><span class="s1">&#39;STATUS_UNKNOWN&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_clear_behavior_fault_error</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Return a custom exception based on response, None if no error.</span>

<span class="sd">    Args:</span>
<span class="sd">        response: Response message to check.</span>

<span class="sd">    Returns:</span>
<span class="sd">        custom exception based on response, None if no error</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="k">return</span> <span class="n">error_factory</span><span class="p">(</span><span class="n">response</span><span class="p">,</span> <span class="n">response</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
                         <span class="n">status_to_string</span><span class="o">=</span><span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">ClearBehaviorFaultResponse</span><span class="o">.</span><span class="n">Status</span><span class="o">.</span><span class="n">Name</span><span class="p">,</span>
                         <span class="n">status_to_error</span><span class="o">=</span><span class="n">_CLEAR_BEHAVIOR_FAULT_STATUS_TO_ERROR</span><span class="p">)</span>


<div class="viewcode-block" id="RobotCommandBuilder"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder">[docs]</a><span class="k">class</span> <span class="nc">RobotCommandBuilder</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;This class contains a set of static helper functions to build and issue robot commands.</span>

<span class="sd">    This is not intended to cover every use case, but rather give developers a starting point for</span>
<span class="sd">    issuing commands to the robot.The robot command proto uses several advanced protobuf techniques,</span>
<span class="sd">    including the use of Any and OneOf.</span>

<span class="sd">    A RobotCommand is composed of one or more commands. The set of valid commands is robot /</span>
<span class="sd">    hardware specific. An armless spot only accepts one command at a time. Each command may or may</span>
<span class="sd">    not take a generic param object. These params are also robot / hardware dependent.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="c1">######################</span>
    <span class="c1"># Full body commands #</span>
    <span class="c1">######################</span>
<div class="viewcode-block" id="RobotCommandBuilder.stop_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.stop_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">stop_command</span><span class="p">():</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command to stop with minimal motion. If the robot is walking, it will transition to</span>
<span class="sd">        stand. If the robot is standing or sitting, it will do nothing.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">full_body_command</span> <span class="o">=</span> <span class="n">full_body_command_pb2</span><span class="o">.</span><span class="n">FullBodyCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">stop_request</span><span class="o">=</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">StopCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">())</span>
        <span class="n">command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">full_body_command</span><span class="o">=</span><span class="n">full_body_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.freeze_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.freeze_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">freeze_command</span><span class="p">():</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command to freeze all joints at their current positions (no balancing control)</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">full_body_command</span> <span class="o">=</span> <span class="n">full_body_command_pb2</span><span class="o">.</span><span class="n">FullBodyCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">freeze_request</span><span class="o">=</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">FreezeCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">())</span>
        <span class="n">command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">full_body_command</span><span class="o">=</span><span class="n">full_body_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.selfright_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.selfright_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">selfright_command</span><span class="p">():</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command to get the robot in a ready, sitting position. If the robot is on its back, it</span>
<span class="sd">        will attempt to flip over.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">full_body_command</span> <span class="o">=</span> <span class="n">full_body_command_pb2</span><span class="o">.</span><span class="n">FullBodyCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">selfright_request</span><span class="o">=</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">SelfRightCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">())</span>
        <span class="n">command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">full_body_command</span><span class="o">=</span><span class="n">full_body_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.battery_change_pose_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.battery_change_pose_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">battery_change_pose_command</span><span class="p">(</span><span class="n">dir_hint</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command that will have the robot sit down (if not already sitting) and roll onto its side</span>
<span class="sd">        for easier battery access.</span>

<span class="sd">        Args:</span>
<span class="sd">            dir_hint: Direction to roll over: 1-right/2-left</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">command</span><span class="o">.</span><span class="n">full_body_command</span><span class="o">.</span><span class="n">battery_change_pose_request</span><span class="o">.</span><span class="n">direction_hint</span> <span class="o">=</span> <span class="n">dir_hint</span>
        <span class="k">return</span> <span class="n">command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.payload_estimation_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.payload_estimation_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">payload_estimation_command</span><span class="p">():</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command to get the robot estimate payload mass.</span>

<span class="sd">        Commands robot to stand and execute a routine to estimate the mass properties of an</span>
<span class="sd">        unregistered payload attached to the robot.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">full_body_command</span> <span class="o">=</span> <span class="n">full_body_command_pb2</span><span class="o">.</span><span class="n">FullBodyCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">payload_estimation_request</span><span class="o">=</span><span class="n">payload_estimation_pb2</span><span class="o">.</span><span class="n">PayloadEstimationCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">())</span>
        <span class="n">command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">full_body_command</span><span class="o">=</span><span class="n">full_body_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.safe_power_off_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.safe_power_off_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">safe_power_off_command</span><span class="p">():</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command to get robot into a position where it is safe to power down, then power down. If</span>
<span class="sd">        the robot has fallen, it will power down directly. If the robot is not in a safe position,</span>
<span class="sd">        it will get to a safe position before powering down. The robot will not power down until it</span>
<span class="sd">        is in a safe state.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">full_body_command</span> <span class="o">=</span> <span class="n">full_body_command_pb2</span><span class="o">.</span><span class="n">FullBodyCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">safe_power_off_request</span><span class="o">=</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">SafePowerOffCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">())</span>
        <span class="n">command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">full_body_command</span><span class="o">=</span><span class="n">full_body_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.constrained_manipulation_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.constrained_manipulation_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">constrained_manipulation_command</span><span class="p">(</span>
        <span class="n">task_type</span><span class="p">,</span> <span class="n">init_wrench_direction_in_frame_name</span><span class="p">,</span> <span class="n">force_limit</span><span class="p">,</span> <span class="n">torque_limit</span><span class="p">,</span> <span class="n">frame_name</span><span class="p">,</span>
        <span class="n">tangential_speed</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">rotational_speed</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">target_linear_position</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
        <span class="n">target_angle</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
        <span class="n">control_mode</span><span class="o">=</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">ConstrainedManipulationCommand</span><span class="o">.</span><span class="n">Request</span><span class="o">.</span><span class="n">CONTROL_MODE_VELOCITY</span><span class="p">,</span>
        <span class="n">reset_estimator</span><span class="o">=</span><span class="n">wrappers_pb2</span><span class="o">.</span><span class="n">BoolValue</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="kc">True</span><span class="p">)):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command constrained manipulation. &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="p">(</span><span class="n">tangential_speed</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">rotational_speed</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">):</span>
            <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s2">&quot;Need either translational or rotational speed&quot;</span><span class="p">)</span>
        <span class="k">if</span> <span class="p">(</span><span class="n">target_angle</span> <span class="ow">and</span> <span class="n">target_linear_position</span><span class="p">):</span>
            <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s2">&quot;Both target_angle and target_linear_position were specified.&quot;</span><span class="p">)</span>

        <span class="n">in_position_control</span> <span class="o">=</span> <span class="n">control_mode</span> <span class="o">==</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">ConstrainedManipulationCommand</span><span class="o">.</span><span class="n">Request</span><span class="o">.</span><span class="n">CONTROL_MODE_POSITION</span>
        <span class="k">if</span> <span class="p">(</span><span class="n">in_position_control</span> <span class="ow">and</span> <span class="ow">not</span> <span class="p">(</span><span class="n">target_angle</span> <span class="ow">or</span> <span class="n">target_linear_position</span><span class="p">)):</span>
            <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span>
                <span class="s2">&quot;We are in position control mode, but neither target angle nor position were specified.&quot;</span>
            <span class="p">)</span>

        <span class="n">full_body_command</span> <span class="o">=</span> <span class="n">full_body_command_pb2</span><span class="o">.</span><span class="n">FullBodyCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">constrained_manipulation_request</span><span class="o">=</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">ConstrainedManipulationCommand</span><span class="o">.</span>
            <span class="n">Request</span><span class="p">(</span><span class="n">task_type</span><span class="o">=</span><span class="n">task_type</span><span class="p">,</span>
                    <span class="n">init_wrench_direction_in_frame_name</span><span class="o">=</span><span class="n">init_wrench_direction_in_frame_name</span><span class="p">,</span>
                    <span class="n">frame_name</span><span class="o">=</span><span class="n">frame_name</span><span class="p">,</span> <span class="n">tangential_speed</span><span class="o">=</span><span class="n">tangential_speed</span><span class="p">,</span>
                    <span class="n">rotational_speed</span><span class="o">=</span><span class="n">rotational_speed</span><span class="p">,</span> <span class="n">target_angle</span><span class="o">=</span><span class="n">target_angle</span><span class="p">,</span>
                    <span class="n">target_linear_position</span><span class="o">=</span><span class="n">target_linear_position</span><span class="p">,</span> <span class="n">control_mode</span><span class="o">=</span><span class="n">control_mode</span><span class="p">,</span>
                    <span class="n">reset_estimator</span><span class="o">=</span><span class="n">reset_estimator</span><span class="p">))</span>

        <span class="n">full_body_command</span><span class="o">.</span><span class="n">constrained_manipulation_request</span><span class="o">.</span><span class="n">force_limit</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">force_limit</span>
        <span class="n">full_body_command</span><span class="o">.</span><span class="n">constrained_manipulation_request</span><span class="o">.</span><span class="n">torque_limit</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">torque_limit</span>
        <span class="n">command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">full_body_command</span><span class="o">=</span><span class="n">full_body_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.joint_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.joint_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">joint_command</span><span class="p">():</span>
        <span class="n">command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">command</span><span class="o">.</span><span class="n">full_body_command</span><span class="o">.</span><span class="n">joint_request</span><span class="o">.</span><span class="n">SetInParent</span><span class="p">()</span>
        <span class="k">return</span> <span class="n">command</span></div>

    <span class="c1">#########################</span>
    <span class="c1"># Synchronized commands #</span>
    <span class="c1">#########################</span>

<div class="viewcode-block" id="RobotCommandBuilder.synchro_se2_trajectory_point_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.synchro_se2_trajectory_point_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">synchro_se2_trajectory_point_command</span><span class="p">(</span><span class="n">goal_x</span><span class="p">,</span> <span class="n">goal_y</span><span class="p">,</span> <span class="n">goal_heading</span><span class="p">,</span> <span class="n">frame_name</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                             <span class="n">body_height</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span>
                                             <span class="n">locomotion_hint</span><span class="o">=</span><span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">HINT_AUTO</span><span class="p">,</span>
                                             <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Command robot to move to pose along a 2D plane. Pose can be specified in the world</span>
<span class="sd">        (kinematic odometry) frame or the robot body frame. The arguments body_height and</span>
<span class="sd">        locomotion_hint are ignored if params argument is passed.</span>

<span class="sd">        A trajectory command requires an end time. End time is not set in this function, but rather</span>
<span class="sd">        is set externally before call to RobotCommandService.</span>

<span class="sd">        Args:</span>
<span class="sd">            goal_x: Position X coordinate.</span>
<span class="sd">            goal_y: Position Y coordinate.</span>
<span class="sd">            goal_heading: Pose heading in radians.</span>
<span class="sd">            frame_name: Name of the frame to use.</span>
<span class="sd">            params(spot.MobilityParams): Spot specific parameters for mobility commands. If not set,</span>
<span class="sd">                this will be constructed using other args.</span>
<span class="sd">            body_height: Height, meters, relative to a nominal stand height.</span>
<span class="sd">            locomotion_hint: Locomotion hint to use for the trajectory command.</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and gripper_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">position</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Vec2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">goal_x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">goal_y</span><span class="p">)</span>
        <span class="n">pose</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">SE2Pose</span><span class="p">(</span><span class="n">position</span><span class="o">=</span><span class="n">position</span><span class="p">,</span> <span class="n">angle</span><span class="o">=</span><span class="n">goal_heading</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">synchro_se2_trajectory_command</span><span class="p">(</span><span class="n">pose</span><span class="p">,</span> <span class="n">frame_name</span><span class="p">,</span> <span class="n">params</span><span class="p">,</span>
                                                                  <span class="n">body_height</span><span class="p">,</span> <span class="n">locomotion_hint</span><span class="p">,</span>
                                                                  <span class="n">build_on_command</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.synchro_se2_trajectory_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.synchro_se2_trajectory_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">synchro_se2_trajectory_command</span><span class="p">(</span><span class="n">goal_se2</span><span class="p">,</span> <span class="n">frame_name</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">body_height</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span>
                                       <span class="n">locomotion_hint</span><span class="o">=</span><span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">HINT_AUTO</span><span class="p">,</span>
                                       <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command robot to move to pose along a 2D plane. Pose can be specified in the world</span>
<span class="sd">        (kinematic odometry or vision world) frames. The arguments body_height and</span>
<span class="sd">        locomotion_hint are ignored if params argument is passed.</span>

<span class="sd">        A trajectory command requires an end time. End time is not set in this function, but rather</span>
<span class="sd">        is set externally before call to RobotCommandService.</span>

<span class="sd">        Args:</span>
<span class="sd">            goal_se2: SE2Pose goal.</span>
<span class="sd">            frame_name: Name of the frame to use.</span>
<span class="sd">            params(spot.MobilityParams): Spot specific parameters for mobility commands. If not set,</span>
<span class="sd">                this will be constructed using other args.</span>
<span class="sd">            body_height: Height, meters, relative to a nominal stand height.</span>
<span class="sd">            locomotion_hint: Locomotion hint to use for the trajectory command.</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and gripper_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="n">params</span><span class="p">:</span>
            <span class="n">params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">mobility_params</span><span class="p">(</span><span class="n">body_height</span><span class="o">=</span><span class="n">body_height</span><span class="p">,</span>
                                                         <span class="n">locomotion_hint</span><span class="o">=</span><span class="n">locomotion_hint</span><span class="p">)</span>
        <span class="n">any_params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">_to_any</span><span class="p">(</span><span class="n">params</span><span class="p">)</span>
        <span class="n">point</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">SE2TrajectoryPoint</span><span class="p">(</span><span class="n">pose</span><span class="o">=</span><span class="n">goal_se2</span><span class="p">)</span>
        <span class="n">traj</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">SE2Trajectory</span><span class="p">(</span><span class="n">points</span><span class="o">=</span><span class="p">[</span><span class="n">point</span><span class="p">])</span>
        <span class="n">traj_command</span> <span class="o">=</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">SE2TrajectoryCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span><span class="n">trajectory</span><span class="o">=</span><span class="n">traj</span><span class="p">,</span>
                                                                      <span class="n">se2_frame_name</span><span class="o">=</span><span class="n">frame_name</span><span class="p">)</span>
        <span class="n">mobility_command</span> <span class="o">=</span> <span class="n">mobility_command_pb2</span><span class="o">.</span><span class="n">MobilityCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">se2_trajectory_request</span><span class="o">=</span><span class="n">traj_command</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">any_params</span><span class="p">)</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">mobility_command</span><span class="o">=</span><span class="n">mobility_command</span><span class="p">)</span>
        <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.synchro_trajectory_command_in_body_frame"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.synchro_trajectory_command_in_body_frame">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">synchro_trajectory_command_in_body_frame</span><span class="p">(</span>
            <span class="n">goal_x_rt_body</span><span class="p">,</span> <span class="n">goal_y_rt_body</span><span class="p">,</span> <span class="n">goal_heading_rt_body</span><span class="p">,</span> <span class="n">frame_tree_snapshot</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
            <span class="n">body_height</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">locomotion_hint</span><span class="o">=</span><span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">HINT_AUTO</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command robot to move to pose described relative to the robots body along a 2D plane. For example,</span>
<span class="sd">        a command to move forward 2 meters at the same heading will have goal_x_rt_body=2.0, goal_y_rt_body=0.0,</span>
<span class="sd">        goal_heading_rt_body=0.0.</span>

<span class="sd">        The arguments body_height and locomotion_hint are ignored if params argument is passed. A trajectory</span>
<span class="sd">        command requires an end time. End time is not set in this function, but rather is set externally before</span>
<span class="sd">        call to RobotCommandService.</span>

<span class="sd">        Args:</span>
<span class="sd">            goal_x_rt_body: Position X coordinate described relative to the body frame.</span>
<span class="sd">            goal_y_rt_body: Position Y coordinate described relative to the body frame.</span>
<span class="sd">            goal_heading_rt_body: Pose heading in radians described relative to the body frame.</span>
<span class="sd">            frame_tree_snapshot: Dictionary representing the child_to_parent_edge_map describing different</span>
<span class="sd">                                 transforms. This can be acquired using the robot state client directly, or using</span>
<span class="sd">                                 the robot object&#39;s helper function robot.get_frame_tree_snapshot().</span>
<span class="sd">            params(spot.MobilityParams): Spot specific parameters for mobility commands. If not set,</span>
<span class="sd">                this will be constructed using other args.</span>
<span class="sd">            body_height: Height, meters, relative to a nominal stand height.</span>
<span class="sd">            locomotion_hint: Locomotion hint to use for the trajectory command.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service. The go-to point will be converted to a</span>
<span class="sd">            non-moving world frame (odom frame) to be issued to the robot.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">goto_rt_body</span> <span class="o">=</span> <span class="n">SE2Pose</span><span class="p">(</span><span class="n">goal_x_rt_body</span><span class="p">,</span> <span class="n">goal_y_rt_body</span><span class="p">,</span> <span class="n">goal_heading_rt_body</span><span class="p">)</span>
        <span class="c1"># Get an SE2 pose for odom_tform_body to convert the body-based command to a non-moving frame</span>
        <span class="c1"># that can be issued to the robot.</span>
        <span class="n">odom_tform_body</span> <span class="o">=</span> <span class="n">get_se2_a_tform_b</span><span class="p">(</span><span class="n">frame_tree_snapshot</span><span class="p">,</span> <span class="n">ODOM_FRAME_NAME</span><span class="p">,</span> <span class="n">BODY_FRAME_NAME</span><span class="p">)</span>
        <span class="n">odom_tform_goto</span> <span class="o">=</span> <span class="n">odom_tform_body</span> <span class="o">*</span> <span class="n">goto_rt_body</span>
        <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">synchro_se2_trajectory_command</span><span class="p">(</span><span class="n">odom_tform_goto</span><span class="o">.</span><span class="n">to_proto</span><span class="p">(),</span>
                                                                  <span class="n">ODOM_FRAME_NAME</span><span class="p">,</span> <span class="n">params</span><span class="p">,</span>
                                                                  <span class="n">body_height</span><span class="p">,</span> <span class="n">locomotion_hint</span><span class="p">,</span>
                                                                  <span class="n">build_on_command</span><span class="o">=</span><span class="n">build_on_command</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.synchro_velocity_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.synchro_velocity_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">synchro_velocity_command</span><span class="p">(</span><span class="n">v_x</span><span class="p">,</span> <span class="n">v_y</span><span class="p">,</span> <span class="n">v_rot</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">body_height</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span>
                                 <span class="n">locomotion_hint</span><span class="o">=</span><span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">HINT_AUTO</span><span class="p">,</span>
                                 <span class="n">frame_name</span><span class="o">=</span><span class="n">BODY_FRAME_NAME</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command robot to move along 2D plane. Velocity should be specified in the robot body</span>
<span class="sd">        frame. Other frames are currently not supported. The arguments body_height and</span>
<span class="sd">        locomotion_hint are ignored if params argument is passed.</span>

<span class="sd">        A velocity command requires an end time. End time is not set in this function, but rather</span>
<span class="sd">        is set externally before call to RobotCommandService.</span>

<span class="sd">        Args:</span>
<span class="sd">            v_x: Velocity in X direction.</span>
<span class="sd">            v_y: Velocity in Y direction.</span>
<span class="sd">            v_rot: Velocity heading in radians.</span>
<span class="sd">            params(spot.MobilityParams): Spot specific parameters for mobility commands. If not set,</span>
<span class="sd">                this will be constructed using other args.</span>
<span class="sd">            body_height: Height, meters, relative to a nominal stand height.</span>
<span class="sd">            locomotion_hint: Locomotion hint to use for the velocity command.</span>
<span class="sd">            frame_name: Name of the frame to use.</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and gripper_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="n">params</span><span class="p">:</span>
            <span class="n">params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">mobility_params</span><span class="p">(</span><span class="n">body_height</span><span class="o">=</span><span class="n">body_height</span><span class="p">,</span>
                                                         <span class="n">locomotion_hint</span><span class="o">=</span><span class="n">locomotion_hint</span><span class="p">)</span>
        <span class="n">any_params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">_to_any</span><span class="p">(</span><span class="n">params</span><span class="p">)</span>
        <span class="n">linear</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Vec2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">v_x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">v_y</span><span class="p">)</span>
        <span class="n">vel</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">SE2Velocity</span><span class="p">(</span><span class="n">linear</span><span class="o">=</span><span class="n">linear</span><span class="p">,</span> <span class="n">angular</span><span class="o">=</span><span class="n">v_rot</span><span class="p">)</span>
        <span class="n">slew_rate_limit</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">SE2Velocity</span><span class="p">(</span><span class="n">linear</span><span class="o">=</span><span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Vec2</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mi">4</span><span class="p">),</span> <span class="n">angular</span><span class="o">=</span><span class="mf">2.0</span><span class="p">)</span>
        <span class="n">vel_command</span> <span class="o">=</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">SE2VelocityCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span><span class="n">velocity</span><span class="o">=</span><span class="n">vel</span><span class="p">,</span>
                                                                   <span class="n">se2_frame_name</span><span class="o">=</span><span class="n">frame_name</span><span class="p">,</span>
                                                                   <span class="n">slew_rate_limit</span><span class="o">=</span><span class="n">slew_rate_limit</span><span class="p">)</span>
        <span class="n">mobility_command</span> <span class="o">=</span> <span class="n">mobility_command_pb2</span><span class="o">.</span><span class="n">MobilityCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">se2_velocity_request</span><span class="o">=</span><span class="n">vel_command</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">any_params</span><span class="p">)</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">mobility_command</span><span class="o">=</span><span class="n">mobility_command</span><span class="p">)</span>
        <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.synchro_stand_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.synchro_stand_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">synchro_stand_command</span><span class="p">(</span><span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">body_height</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">footprint_R_body</span><span class="o">=</span><span class="n">geometry</span><span class="o">.</span><span class="n">EulerZXY</span><span class="p">(),</span>
                              <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command robot to stand. If the robot is sitting, it will stand up. If the robot is</span>
<span class="sd">        moving, it will come to a stop. Params can specify a trajectory for the body to follow</span>
<span class="sd">        while standing. In the simplest case, this can be a specific position+orientation which the</span>
<span class="sd">        body will hold at. The arguments body_height and footprint_R_body are ignored if params</span>
<span class="sd">        argument is passed.</span>

<span class="sd">        Args:</span>
<span class="sd">            params(spot.MobilityParams): Spot specific parameters for mobility commands. If not set,</span>
<span class="sd">                this will be constructed using other args.</span>
<span class="sd">            body_height(float): Height, meters, to stand at relative to a nominal stand height.</span>
<span class="sd">            footprint_R_body(EulerZXY): The orientation of the body frame with respect to the</span>
<span class="sd">                footprint frame (gravity aligned framed with yaw computed from the stance feet)</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and gripper_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="n">params</span><span class="p">:</span>
            <span class="n">params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">mobility_params</span><span class="p">(</span><span class="n">body_height</span><span class="o">=</span><span class="n">body_height</span><span class="p">,</span>
                                                         <span class="n">footprint_R_body</span><span class="o">=</span><span class="n">footprint_R_body</span><span class="p">)</span>
        <span class="n">any_params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">_to_any</span><span class="p">(</span><span class="n">params</span><span class="p">)</span>
        <span class="n">mobility_command</span> <span class="o">=</span> <span class="n">mobility_command_pb2</span><span class="o">.</span><span class="n">MobilityCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">stand_request</span><span class="o">=</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">StandCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(),</span> <span class="n">params</span><span class="o">=</span><span class="n">any_params</span><span class="p">)</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">mobility_command</span><span class="o">=</span><span class="n">mobility_command</span><span class="p">)</span>
        <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.synchro_sit_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.synchro_sit_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">synchro_sit_command</span><span class="p">(</span><span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command the robot to sit.</span>

<span class="sd">        Args:</span>
<span class="sd">            params(spot.MobilityParams): Spot specific parameters for mobility commands.</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and gripper_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="n">params</span><span class="p">:</span>
            <span class="n">params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">mobility_params</span><span class="p">()</span>
        <span class="n">any_params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">_to_any</span><span class="p">(</span><span class="n">params</span><span class="p">)</span>
        <span class="n">mobility_command</span> <span class="o">=</span> <span class="n">mobility_command_pb2</span><span class="o">.</span><span class="n">MobilityCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">sit_request</span><span class="o">=</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">SitCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(),</span> <span class="n">params</span><span class="o">=</span><span class="n">any_params</span><span class="p">)</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">mobility_command</span><span class="o">=</span><span class="n">mobility_command</span><span class="p">)</span>
        <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.stance_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.stance_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">stance_command</span><span class="p">(</span><span class="n">se2_frame_name</span><span class="p">,</span> <span class="n">pos_fl_rt_frame</span><span class="p">,</span> <span class="n">pos_fr_rt_frame</span><span class="p">,</span> <span class="n">pos_hl_rt_frame</span><span class="p">,</span>
                       <span class="n">pos_hr_rt_frame</span><span class="p">,</span> <span class="n">accuracy</span><span class="o">=</span><span class="mf">0.05</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">body_height</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span>
                       <span class="n">footprint_R_body</span><span class="o">=</span><span class="n">geometry</span><span class="o">.</span><span class="n">EulerZXY</span><span class="p">(),</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command robot to stance with the feet at specified positions.</span>
<span class="sd">        This will cause the robot to reposition its feet. This is not intended to be a mobility</span>
<span class="sd">        command and will reject commands where the foot position is out of reach without locomoting.</span>
<span class="sd">        To stance at a far location, try using SE2TrajectoryCommand to safely put the robot at the</span>
<span class="sd">        correct location first.</span>

<span class="sd">        Params can specify a trajectory for the body to follow</span>
<span class="sd">        while stancing. In the simplest case, this can be a specific position+orientation which the</span>
<span class="sd">        body will hold at. The arguments body_height and footprint_R_body are ignored if params</span>
<span class="sd">        argument is passed.</span>

<span class="sd">        Args:</span>
<span class="sd">            se2_frame_name(string): The frame name which the desired foot_positions are described in.</span>
<span class="sd">            pos_fl_rt_frame(Vec2): Position of front left foot in specified frame.</span>
<span class="sd">            pos_fr_rt_frame(Vec2): Position of front right foot in specified frame.</span>
<span class="sd">            pos_hl_rt_frame(Vec2): Position of rear left foot in specified frame.</span>
<span class="sd">            pos_hr_rt_frame(Vec2): Position of rear right foot in specified frame.</span>
<span class="sd">            accuracy(float): Required foot positional accuracy in meters</span>
<span class="sd">            params(spot.MobilityParams): Spot specific parameters for mobility commands. If not set,</span>
<span class="sd">                this will be constructed using other args.</span>
<span class="sd">            body_height(float): Height, meters, to stand at relative to a nominal stand height.</span>
<span class="sd">            footprint_R_body(EulerZXY): The orientation of the body frame with respect to the</span>
<span class="sd">                footprint frame (gravity aligned framed with yaw computed from the stance feet)</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and gripper_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>
<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="n">params</span><span class="p">:</span>
            <span class="n">params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">mobility_params</span><span class="p">(</span><span class="n">body_height</span><span class="o">=</span><span class="n">body_height</span><span class="p">,</span>
                                                         <span class="n">footprint_R_body</span><span class="o">=</span><span class="n">footprint_R_body</span><span class="p">)</span>
        <span class="n">any_params</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">_to_any</span><span class="p">(</span><span class="n">params</span><span class="p">)</span>

        <span class="n">stance_request</span> <span class="o">=</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">StanceCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">()</span>
        <span class="n">stance_request</span><span class="o">.</span><span class="n">stance</span><span class="o">.</span><span class="n">se2_frame_name</span> <span class="o">=</span> <span class="n">se2_frame_name</span>
        <span class="n">stance_request</span><span class="o">.</span><span class="n">stance</span><span class="o">.</span><span class="n">accuracy</span> <span class="o">=</span> <span class="n">accuracy</span>
        <span class="n">stance_request</span><span class="o">.</span><span class="n">stance</span><span class="o">.</span><span class="n">foot_positions</span><span class="p">[</span><span class="s1">&#39;fl&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">pos_fl_rt_frame</span><span class="p">)</span>
        <span class="n">stance_request</span><span class="o">.</span><span class="n">stance</span><span class="o">.</span><span class="n">foot_positions</span><span class="p">[</span><span class="s1">&#39;fr&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">pos_fr_rt_frame</span><span class="p">)</span>
        <span class="n">stance_request</span><span class="o">.</span><span class="n">stance</span><span class="o">.</span><span class="n">foot_positions</span><span class="p">[</span><span class="s1">&#39;hl&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">pos_hl_rt_frame</span><span class="p">)</span>
        <span class="n">stance_request</span><span class="o">.</span><span class="n">stance</span><span class="o">.</span><span class="n">foot_positions</span><span class="p">[</span><span class="s1">&#39;hr&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">pos_hr_rt_frame</span><span class="p">)</span>

        <span class="n">mobility_command</span> <span class="o">=</span> <span class="n">mobility_command_pb2</span><span class="o">.</span><span class="n">MobilityCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">stance_request</span><span class="o">=</span><span class="n">stance_request</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">any_params</span><span class="p">)</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">mobility_command</span><span class="o">=</span><span class="n">mobility_command</span><span class="p">)</span>
        <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.follow_arm_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.follow_arm_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">follow_arm_command</span><span class="p">():</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Command robot&#39;s body to follow the arm around.</span>

<span class="sd">        Args:</span>
<span class="sd">            params(spot.MobilityParams): Spot specific parameters for mobility commands.</span>
<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">mobility_command</span> <span class="o">=</span> <span class="n">mobility_command_pb2</span><span class="o">.</span><span class="n">MobilityCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">follow_arm_request</span><span class="o">=</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">FollowArmCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">())</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">mobility_command</span><span class="o">=</span><span class="n">mobility_command</span><span class="p">)</span>
        <span class="n">command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_stow_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_stow_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_stow_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">_arm_named_command</span><span class="p">(</span>
            <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">NamedArmPositionsCommand</span><span class="o">.</span><span class="n">POSITIONS_STOW</span><span class="p">,</span> <span class="n">build_on_command</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_ready_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_ready_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_ready_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">_arm_named_command</span><span class="p">(</span>
            <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">NamedArmPositionsCommand</span><span class="o">.</span><span class="n">POSITIONS_READY</span><span class="p">,</span> <span class="n">build_on_command</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_carry_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_carry_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_carry_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">_arm_named_command</span><span class="p">(</span>
            <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">NamedArmPositionsCommand</span><span class="o">.</span><span class="n">POSITIONS_CARRY</span><span class="p">,</span> <span class="n">build_on_command</span><span class="p">)</span></div>

    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">_arm_named_command</span><span class="p">(</span><span class="n">position</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="n">stow_arm_position_command</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">NamedArmPositionsCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">position</span><span class="o">=</span><span class="n">position</span><span class="p">)</span>
        <span class="n">arm_command</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">named_arm_position_command</span><span class="o">=</span><span class="n">stow_arm_position_command</span><span class="p">)</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">arm_command</span><span class="o">=</span><span class="n">arm_command</span><span class="p">)</span>
        <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span>

<div class="viewcode-block" id="RobotCommandBuilder.arm_gaze_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_gaze_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_gaze_command</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">,</span> <span class="n">frame_name</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">frame2_tform_desired_hand</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                         <span class="n">frame2_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_linear_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_angular_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                         <span class="n">max_accel</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot; Builds a Vec3Trajectory to tell the robot arm to gaze at a point in 3D space.</span>
<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">pos</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Vec3</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="o">=</span><span class="n">z</span><span class="p">)</span>
        <span class="n">point1</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">Vec3TrajectoryPoint</span><span class="p">(</span><span class="n">point</span><span class="o">=</span><span class="n">pos</span><span class="p">)</span>

        <span class="n">traj</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">Vec3Trajectory</span><span class="p">(</span><span class="n">points</span><span class="o">=</span><span class="p">[</span><span class="n">point1</span><span class="p">])</span>
        <span class="c1"># Build the proto</span>
        <span class="n">gaze_cmd</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">GazeCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span><span class="n">target_trajectory_in_frame1</span><span class="o">=</span><span class="n">traj</span><span class="p">,</span>
                                                       <span class="n">frame1_name</span><span class="o">=</span><span class="n">frame_name</span><span class="p">)</span>

        <span class="k">if</span> <span class="n">frame2_tform_desired_hand</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">frame2_name</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">frame2_tform_desired_hand</span><span class="p">,</span> <span class="n">SE3Pose</span><span class="p">):</span>
                <span class="c1"># Convert input argument from math_helpers class to protobuf message.</span>
                <span class="n">frame2_tform_desired_hand</span> <span class="o">=</span> <span class="n">frame2_tform_desired_hand</span><span class="o">.</span><span class="n">to_proto</span><span class="p">()</span>

            <span class="n">desired_point</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">SE3TrajectoryPoint</span><span class="p">(</span><span class="n">pose</span><span class="o">=</span><span class="n">frame2_tform_desired_hand</span><span class="p">)</span>
            <span class="n">gaze_cmd</span><span class="o">.</span><span class="n">tool_trajectory_in_frame2</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="n">desired_point</span><span class="p">])</span>
            <span class="n">gaze_cmd</span><span class="o">.</span><span class="n">frame2_name</span> <span class="o">=</span> <span class="n">frame2_name</span>

        <span class="k">if</span> <span class="n">max_linear_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">gaze_cmd</span><span class="o">.</span><span class="n">max_linear_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_linear_vel</span>
        <span class="k">if</span> <span class="n">max_angular_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">gaze_cmd</span><span class="o">.</span><span class="n">max_angular_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_angular_vel</span>
        <span class="k">if</span> <span class="n">max_accel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">gaze_cmd</span><span class="o">.</span><span class="n">maximum_acceleration</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_accel</span>

        <span class="n">arm_command</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span><span class="n">arm_gaze_command</span><span class="o">=</span><span class="n">gaze_cmd</span><span class="p">)</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">arm_command</span><span class="o">=</span><span class="n">arm_command</span><span class="p">)</span>
        <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_pose_command_from_pose"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_pose_command_from_pose">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_pose_command_from_pose</span><span class="p">(</span><span class="n">hand_pose</span><span class="p">,</span> <span class="n">frame_name</span><span class="p">,</span> <span class="n">seconds</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot; Builds an SE3Trajectory Point to tell robot arm to move to a pose in space</span>
<span class="sd">        relative to the frame specified. Wraps it in SynchronizedCommand.</span>

<span class="sd">        Args:</span>
<span class="sd">            hand_pose(geometry_pb2.SE3Pose): Protobuf message specifying the desired pose of the</span>
<span class="sd">                hand.</span>
<span class="sd">            frame_name(string): Name of the frame relative to which `hand_pose` is expressed.</span>
<span class="sd">            seconds(float): Requested duration of the arm move.</span>
<span class="sd">            build_on_command(robot_command_pb2.RobotCommand): Optional RobotCommand (not</span>
<span class="sd">                containing a full_body_command). A mobility_command and gripper_command from</span>
<span class="sd">                `build_on_command` will be added to the RobotCommand returned by this function.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.&quot;&quot;&quot;</span>
        <span class="n">duration</span> <span class="o">=</span> <span class="n">seconds_to_duration</span><span class="p">(</span><span class="n">seconds</span><span class="p">)</span>
        <span class="n">hand_pose_traj_point</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">SE3TrajectoryPoint</span><span class="p">(</span><span class="n">pose</span><span class="o">=</span><span class="n">hand_pose</span><span class="p">,</span>
                                                                 <span class="n">time_since_reference</span><span class="o">=</span><span class="n">duration</span><span class="p">)</span>
        <span class="n">hand_trajectory</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">SE3Trajectory</span><span class="p">(</span><span class="n">points</span><span class="o">=</span><span class="p">[</span><span class="n">hand_pose_traj_point</span><span class="p">])</span>

        <span class="n">arm_cartesian_command</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">root_frame_name</span><span class="o">=</span><span class="n">frame_name</span><span class="p">,</span> <span class="n">pose_trajectory_in_task</span><span class="o">=</span><span class="n">hand_trajectory</span><span class="p">)</span>
        <span class="n">arm_command</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">arm_cartesian_command</span><span class="o">=</span><span class="n">arm_cartesian_command</span><span class="p">)</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">arm_command</span><span class="o">=</span><span class="n">arm_command</span><span class="p">)</span>
        <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_pose_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_pose_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_pose_command</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">,</span> <span class="n">qw</span><span class="p">,</span> <span class="n">qx</span><span class="p">,</span> <span class="n">qy</span><span class="p">,</span> <span class="n">qz</span><span class="p">,</span> <span class="n">frame_name</span><span class="p">,</span> <span class="n">seconds</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot; Builds an SE3Trajectory Point to tell robot arm to move to a pose in space</span>
<span class="sd">        relative to the frame specified. Wraps it in SynchronizedCommand.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.&quot;&quot;&quot;</span>
        <span class="n">position</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Vec3</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="o">=</span><span class="n">z</span><span class="p">)</span>
        <span class="n">rotation</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Quaternion</span><span class="p">(</span><span class="n">w</span><span class="o">=</span><span class="n">qw</span><span class="p">,</span> <span class="n">x</span><span class="o">=</span><span class="n">qx</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">qy</span><span class="p">,</span> <span class="n">z</span><span class="o">=</span><span class="n">qz</span><span class="p">)</span>
        <span class="n">hand_pose</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">SE3Pose</span><span class="p">(</span><span class="n">position</span><span class="o">=</span><span class="n">position</span><span class="p">,</span> <span class="n">rotation</span><span class="o">=</span><span class="n">rotation</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">arm_pose_command_from_pose</span><span class="p">(</span><span class="n">hand_pose</span><span class="p">,</span> <span class="n">frame_name</span><span class="p">,</span>
                                                              <span class="n">seconds</span><span class="o">=</span><span class="n">seconds</span><span class="p">,</span>
                                                              <span class="n">build_on_command</span><span class="o">=</span><span class="n">build_on_command</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_wrench_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_wrench_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_wrench_command</span><span class="p">(</span><span class="n">force_x</span><span class="p">,</span> <span class="n">force_y</span><span class="p">,</span> <span class="n">force_z</span><span class="p">,</span> <span class="n">torque_x</span><span class="p">,</span> <span class="n">torque_y</span><span class="p">,</span> <span class="n">torque_z</span><span class="p">,</span> <span class="n">frame_name</span><span class="p">,</span>
                           <span class="n">seconds</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot; Builds a command to tell robot arm to exhibit a wrench.</span>
<span class="sd">            Wraps it in a SynchronizedCommand.</span>

<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand, which can be issued to the robot command service.&quot;&quot;&quot;</span>
        <span class="n">force</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Vec3</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">force_x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">force_y</span><span class="p">,</span> <span class="n">z</span><span class="o">=</span><span class="n">force_z</span><span class="p">)</span>
        <span class="n">torque</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Vec3</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">torque_x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">torque_y</span><span class="p">,</span> <span class="n">z</span><span class="o">=</span><span class="n">torque_z</span><span class="p">)</span>

        <span class="n">wrench</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Wrench</span><span class="p">(</span><span class="n">force</span><span class="o">=</span><span class="n">force</span><span class="p">,</span> <span class="n">torque</span><span class="o">=</span><span class="n">torque</span><span class="p">)</span>
        <span class="n">duration</span> <span class="o">=</span> <span class="n">seconds_to_duration</span><span class="p">(</span><span class="n">seconds</span><span class="p">)</span>
        <span class="n">traj_point</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">WrenchTrajectoryPoint</span><span class="p">(</span><span class="n">wrench</span><span class="o">=</span><span class="n">wrench</span><span class="p">,</span>
                                                          <span class="n">time_since_reference</span><span class="o">=</span><span class="n">duration</span><span class="p">)</span>
        <span class="n">trajectory</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">WrenchTrajectory</span><span class="p">(</span><span class="n">points</span><span class="o">=</span><span class="p">[</span><span class="n">traj_point</span><span class="p">])</span>

        <span class="n">arm_cartesian_command</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">root_frame_name</span><span class="o">=</span><span class="n">frame_name</span><span class="p">,</span> <span class="n">wrench_trajectory_in_task</span><span class="o">=</span><span class="n">trajectory</span><span class="p">,</span>
            <span class="n">x_axis</span><span class="o">=</span><span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Request</span><span class="o">.</span><span class="n">AXIS_MODE_FORCE</span><span class="p">,</span>
            <span class="n">y_axis</span><span class="o">=</span><span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Request</span><span class="o">.</span><span class="n">AXIS_MODE_FORCE</span><span class="p">,</span>
            <span class="n">z_axis</span><span class="o">=</span><span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Request</span><span class="o">.</span><span class="n">AXIS_MODE_FORCE</span><span class="p">,</span>
            <span class="n">rx_axis</span><span class="o">=</span><span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Request</span><span class="o">.</span><span class="n">AXIS_MODE_FORCE</span><span class="p">,</span>
            <span class="n">ry_axis</span><span class="o">=</span><span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Request</span><span class="o">.</span><span class="n">AXIS_MODE_FORCE</span><span class="p">,</span>
            <span class="n">rz_axis</span><span class="o">=</span><span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Request</span><span class="o">.</span><span class="n">AXIS_MODE_FORCE</span><span class="p">)</span>
        <span class="n">arm_command</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">arm_cartesian_command</span><span class="o">=</span><span class="n">arm_cartesian_command</span><span class="p">)</span>
        <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
            <span class="n">arm_command</span><span class="o">=</span><span class="n">arm_command</span><span class="p">)</span>
        <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_command</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.claw_gripper_open_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.claw_gripper_open_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">claw_gripper_open_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_acc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Builds a command to open the gripper.  Wraps it in SynchronizedCommand.</span>

<span class="sd">        Args:</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and mobility_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>
<span class="sd">            max_acc: Optional maximum allowable gripper acceleration. Not setting this will lead to the</span>
<span class="sd">                        robot using a relatively safe low default. If the user is sure their gripper</span>
<span class="sd">                        trajectory is safe and achievable, this can be set to a large value so it</span>
<span class="sd">                        doesn&#39;t get in the way.</span>
<span class="sd">            max_vel: Optional maximum allowable gripper velocity. Same thing about defaults as max_acc.</span>

<span class="sd">        Returns:</span>
<span class="sd">            robot_command_pb2.RobotCommand with a claw_gripper_command filled out.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">robot_cmd</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">gripper_cmd</span> <span class="o">=</span> <span class="n">robot_cmd</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">gripper_command</span><span class="o">.</span><span class="n">claw_gripper_command</span>
        <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">trajectory</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">add</span><span class="p">()</span><span class="o">.</span><span class="n">point</span> <span class="o">=</span> <span class="n">_CLAW_GRIPPER_OPEN_ANGLE</span>

        <span class="k">if</span> <span class="n">max_acc</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint acceleration if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_acceleration</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_acc</span>
        <span class="k">if</span> <span class="n">max_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint velocity if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_vel</span>

        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_cmd</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_cmd</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.claw_gripper_close_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.claw_gripper_close_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">claw_gripper_close_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_acc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                   <span class="n">disable_force_on_contact</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">max_torque</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Builds a command to close the gripper.  Wraps it in SynchronizedCommand.</span>

<span class="sd">        Args:</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and mobility_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>
<span class="sd">            max_acc: Optional maximum allowable gripper acceleration. Not setting this will lead to the</span>
<span class="sd">                        robot using a relatively safe low default. If the user is sure their gripper</span>
<span class="sd">                        trajectory is safe and achievable, this can be set to a large value so it</span>
<span class="sd">                        doesn&#39;t get in the way.</span>
<span class="sd">            max_vel: Optional maximum allowable gripper velocity. Same thing about defaults as max_acc.</span>
<span class="sd">            disable_force_on_contact: Whether to switch the gripper to force control on contact detection.</span>
<span class="sd">            max_torque: Optional Maximum torque applied if contact detected closing the gripper. If</span>
<span class="sd">                unspecified, a default value of 5.5 (Nm) will be used.</span>

<span class="sd">        Returns:</span>
<span class="sd">            robot_command_pb2.RobotCommand with a claw_gripper_command filled out.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">robot_cmd</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">gripper_cmd</span> <span class="o">=</span> <span class="n">robot_cmd</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">gripper_command</span><span class="o">.</span><span class="n">claw_gripper_command</span>
        <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">trajectory</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">add</span><span class="p">()</span><span class="o">.</span><span class="n">point</span> <span class="o">=</span> <span class="n">_CLAW_GRIPPER_CLOSED_ANGLE</span>

        <span class="k">if</span> <span class="n">max_acc</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint acceleration if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_acceleration</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_acc</span>
        <span class="k">if</span> <span class="n">max_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint velocity if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_vel</span>
        <span class="k">if</span> <span class="n">max_torque</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Maximum torque applied if contact detected closing the gripper.</span>
            <span class="c1"># If unspecified, a default value of 5.5 (Nm) will be used.</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_torque</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_torque</span>

        <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">disable_force_on_contact</span> <span class="o">=</span> <span class="n">disable_force_on_contact</span>

        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_cmd</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_cmd</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.claw_gripper_open_fraction_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.claw_gripper_open_fraction_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">claw_gripper_open_fraction_command</span><span class="p">(</span><span class="n">open_fraction</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_acc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                           <span class="n">max_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">disable_force_on_contact</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
                                           <span class="n">max_torque</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Builds a command to set the gripper using a fractional input.  Wraps it in SynchronizedCommand.</span>

<span class="sd">        Args:</span>
<span class="sd">            open_fraction: Percentage [0, 1] to open the gripper.  0 fully closed, 1 fully open.</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and mobility_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>
<span class="sd">            max_acc: Optional maximum allowable gripper acceleration. Not setting this will lead to the</span>
<span class="sd">                        robot using a relatively safe low default. If the user is sure their gripper</span>
<span class="sd">                        trajectory is safe and achievable, this can be set to a large value so it</span>
<span class="sd">                        doesn&#39;t get in the way.</span>
<span class="sd">            max_vel: Optional maximum allowable gripper velocity. Same thing about defaults as max_acc.</span>
<span class="sd">            disable_force_on_contact: Whether to switch the gripper to force control on contact detection.</span>
<span class="sd">            max_torque: Optional Maximum torque applied if contact detected closing the gripper. If</span>
<span class="sd">                unspecified, a default value of 5.5 (Nm) will be used.</span>

<span class="sd">        Returns:</span>
<span class="sd">            robot_command_pb2.RobotCommand with a claw_gripper_command filled out.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">gripper_q</span> <span class="o">=</span> <span class="mi">0</span>
        <span class="k">if</span> <span class="n">open_fraction</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
            <span class="n">gripper_q</span> <span class="o">=</span> <span class="n">_CLAW_GRIPPER_CLOSED_ANGLE</span>
        <span class="k">elif</span> <span class="n">open_fraction</span> <span class="o">&gt;=</span> <span class="mi">1</span><span class="p">:</span>
            <span class="n">gripper_q</span> <span class="o">=</span> <span class="n">_CLAW_GRIPPER_OPEN_ANGLE</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">gripper_q</span> <span class="o">=</span> <span class="p">((</span><span class="n">_CLAW_GRIPPER_OPEN_ANGLE</span> <span class="o">-</span> <span class="n">_CLAW_GRIPPER_CLOSED_ANGLE</span><span class="p">)</span> <span class="o">*</span>
                         <span class="n">open_fraction</span><span class="p">)</span> <span class="o">+</span> <span class="n">_CLAW_GRIPPER_CLOSED_ANGLE</span>

        <span class="n">robot_cmd</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">gripper_cmd</span> <span class="o">=</span> <span class="n">robot_cmd</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">gripper_command</span><span class="o">.</span><span class="n">claw_gripper_command</span>
        <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">trajectory</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">add</span><span class="p">()</span><span class="o">.</span><span class="n">point</span> <span class="o">=</span> <span class="n">gripper_q</span>

        <span class="k">if</span> <span class="n">max_acc</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint acceleration if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_acceleration</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_acc</span>
        <span class="k">if</span> <span class="n">max_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint velocity if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_vel</span>
        <span class="k">if</span> <span class="n">max_torque</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Maximum torque applied if contact detected closing the gripper.</span>
            <span class="c1"># If unspecified, a default value of 5.5 (Nm) will be used.</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_torque</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_torque</span>

        <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">disable_force_on_contact</span> <span class="o">=</span> <span class="n">disable_force_on_contact</span>

        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_cmd</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_cmd</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.claw_gripper_open_angle_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.claw_gripper_open_angle_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">claw_gripper_open_angle_command</span><span class="p">(</span><span class="n">gripper_q</span><span class="p">,</span> <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_acc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                        <span class="n">max_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">disable_force_on_contact</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
                                        <span class="n">max_torque</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Builds a command to set the gripper open angle.  Wraps it in SynchronizedCommand.</span>

<span class="sd">        Args:</span>
<span class="sd">            gripper_q: [-1.5708, 0] where -1.5708 is fully open and 0 is fully closed.</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and mobility_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>
<span class="sd">            max_acc: Optional maximum allowable gripper acceleration. Not setting this will lead to the</span>
<span class="sd">                        robot using a relatively safe low default. If the user is sure their gripper</span>
<span class="sd">                        trajectory is safe and achievable, this can be set to a large value so it</span>
<span class="sd">                        doesn&#39;t get in the way.</span>
<span class="sd">            max_vel: Optional maximum allowable gripper velocity. Same thing about defaults as max_acc.</span>
<span class="sd">            disable_force_on_contact: Whether to switch the gripper to force control on contact detection.</span>
<span class="sd">            max_torque: Optional Maximum torque applied if contact detected closing the gripper. If</span>
<span class="sd">                unspecified, a default value of 5.5 (Nm) will be used.</span>

<span class="sd">        Returns:</span>
<span class="sd">            robot_command_pb2.RobotCommand with a claw_gripper_command filled out.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">robot_cmd</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">gripper_cmd</span> <span class="o">=</span> <span class="n">robot_cmd</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">gripper_command</span><span class="o">.</span><span class="n">claw_gripper_command</span>
        <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">trajectory</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">add</span><span class="p">()</span><span class="o">.</span><span class="n">point</span> <span class="o">=</span> <span class="n">gripper_q</span>

        <span class="k">if</span> <span class="n">max_acc</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint acceleration if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_acceleration</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_acc</span>
        <span class="k">if</span> <span class="n">max_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint velocity if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_vel</span>
        <span class="k">if</span> <span class="n">max_torque</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Maximum torque applied if contact detected closing the gripper.</span>
            <span class="c1"># If unspecified, a default value of 5.5 (Nm) will be used.</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_torque</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_torque</span>

        <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">disable_force_on_contact</span> <span class="o">=</span> <span class="n">disable_force_on_contact</span>

        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_cmd</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_cmd</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.create_arm_joint_trajectory_point"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.create_arm_joint_trajectory_point">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">create_arm_joint_trajectory_point</span><span class="p">(</span><span class="n">sh0</span><span class="p">,</span> <span class="n">sh1</span><span class="p">,</span> <span class="n">el0</span><span class="p">,</span> <span class="n">el1</span><span class="p">,</span> <span class="n">wr0</span><span class="p">,</span> <span class="n">wr1</span><span class="p">,</span>
                                          <span class="n">time_since_reference_secs</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="n">joint_position</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmJointPosition</span><span class="p">(</span>
            <span class="n">sh0</span><span class="o">=</span><span class="n">wrappers_pb2</span><span class="o">.</span><span class="n">DoubleValue</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">sh0</span><span class="p">),</span> <span class="n">sh1</span><span class="o">=</span><span class="n">wrappers_pb2</span><span class="o">.</span><span class="n">DoubleValue</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">sh1</span><span class="p">),</span>
            <span class="n">el0</span><span class="o">=</span><span class="n">wrappers_pb2</span><span class="o">.</span><span class="n">DoubleValue</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">el0</span><span class="p">),</span> <span class="n">el1</span><span class="o">=</span><span class="n">wrappers_pb2</span><span class="o">.</span><span class="n">DoubleValue</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">el1</span><span class="p">),</span>
            <span class="n">wr0</span><span class="o">=</span><span class="n">wrappers_pb2</span><span class="o">.</span><span class="n">DoubleValue</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">wr0</span><span class="p">),</span> <span class="n">wr1</span><span class="o">=</span><span class="n">wrappers_pb2</span><span class="o">.</span><span class="n">DoubleValue</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">wr1</span><span class="p">))</span>
        <span class="k">if</span> <span class="n">time_since_reference_secs</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmJointTrajectoryPoint</span><span class="p">(</span>
                <span class="n">position</span><span class="o">=</span><span class="n">joint_position</span><span class="p">,</span>
                <span class="n">time_since_reference</span><span class="o">=</span><span class="n">seconds_to_duration</span><span class="p">(</span><span class="n">time_since_reference_secs</span><span class="p">))</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmJointTrajectoryPoint</span><span class="p">(</span><span class="n">position</span><span class="o">=</span><span class="n">joint_position</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_joint_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_joint_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_joint_command</span><span class="p">(</span><span class="n">sh0</span><span class="p">,</span> <span class="n">sh1</span><span class="p">,</span> <span class="n">el0</span><span class="p">,</span> <span class="n">el1</span><span class="p">,</span> <span class="n">wr0</span><span class="p">,</span> <span class="n">wr1</span><span class="p">,</span> <span class="n">max_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_accel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                          <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="n">traj_point1</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">create_arm_joint_trajectory_point</span><span class="p">(</span>
            <span class="n">sh0</span><span class="p">,</span> <span class="n">sh1</span><span class="p">,</span> <span class="n">el0</span><span class="p">,</span> <span class="n">el1</span><span class="p">,</span> <span class="n">wr0</span><span class="p">,</span> <span class="n">wr1</span><span class="p">)</span>
        <span class="n">arm_joint_traj</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmJointTrajectory</span><span class="p">(</span><span class="n">points</span><span class="o">=</span><span class="p">[</span><span class="n">traj_point1</span><span class="p">])</span>

        <span class="k">if</span> <span class="n">max_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">arm_joint_traj</span><span class="o">.</span><span class="n">maximum_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_vel</span>
        <span class="k">if</span> <span class="n">max_accel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">arm_joint_traj</span><span class="o">.</span><span class="n">maximum_acceleration</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_accel</span>

        <span class="n">joint_move_command</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmJointMoveCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span><span class="n">trajectory</span><span class="o">=</span><span class="n">arm_joint_traj</span><span class="p">)</span>
        <span class="n">arm_command</span> <span class="o">=</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span><span class="n">arm_joint_move_command</span><span class="o">=</span><span class="n">joint_move_command</span><span class="p">)</span>
        <span class="n">sync_arm</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span><span class="n">arm_command</span><span class="o">=</span><span class="n">arm_command</span><span class="p">)</span>
        <span class="n">arm_sync_robot_cmd</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span><span class="n">synchronized_command</span><span class="o">=</span><span class="n">sync_arm</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">arm_sync_robot_cmd</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">arm_sync_robot_cmd</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_joint_move_helper"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_joint_move_helper">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_joint_move_helper</span><span class="p">(</span>
            <span class="n">joint_positions</span><span class="p">,</span>
            <span class="n">times</span><span class="p">,</span>
            <span class="n">joint_velocities</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
            <span class="n">ref_time</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
            <span class="n">max_acc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
            <span class="n">max_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
            <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
    <span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Given a set of joint positions, times, and optional velocity, create a synchro command.</span>

<span class="sd">        Args:</span>
<span class="sd">            joint_positions: A list of length N with joint positions at each knot point in our</span>
<span class="sd">                            trajectory. Each knot joint position is represented as a list of length 6,</span>
<span class="sd">                            representing the 6 joint angles [sh0, sh1, el0, el1, wr0, wr1]</span>
<span class="sd">            times: A list of length N with the corresponding time_since_reference for each of our knots</span>
<span class="sd">            joint_velocities: Optional joint velocities at each knot. Same structure as joint_positions</span>
<span class="sd">            ref_time: Optional robot reference time. If unset, we&#39;ll use the current synchronized robot</span>
<span class="sd">                        time. Setting this is useful for getting a consistent trajectory over a long</span>
<span class="sd">                        period of time when many ArmJointMoveRequest commands are chained together.</span>
<span class="sd">            max_acc: Optional maximum allowable joint acceleration. Not setting this will lead to the</span>
<span class="sd">                        robot using a relatively safe low default. If the user is sure their joint</span>
<span class="sd">                        trajectory is safe and achievable, this can be set to a large value so it</span>
<span class="sd">                        doesn&#39;t get in the way.</span>
<span class="sd">            max_vel: Optional maximum allowable joint velocity. Same thing about defaults as max_acc</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). A</span>
<span class="sd">                mobility_command and gripper_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>

<span class="sd">        Returns:</span>
<span class="sd">            robot_command_pb2.RobotCommand with an arm_joint_move_command filled out.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="k">assert</span> <span class="n">joint_positions</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">,</span> <span class="s2">&quot;Must pass in a list of joint positions&quot;</span>
        <span class="k">assert</span> <span class="n">times</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">,</span> <span class="s2">&quot;Must pass in a list of times&quot;</span>
        <span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">joint_positions</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span>
            <span class="n">times</span><span class="p">),</span> <span class="s2">&quot;Number of joint positions must match number of times&quot;</span>
        <span class="k">if</span> <span class="n">joint_velocities</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">joint_velocities</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span>
                <span class="n">times</span><span class="p">),</span> <span class="s2">&quot;Number of joint velocities must match number of times&quot;</span>

        <span class="c1"># Create an arm joint move command, and set the trajectory</span>
        <span class="n">robot_cmd</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">arm_joint_traj</span> <span class="o">=</span> <span class="p">(</span>
            <span class="n">robot_cmd</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">arm_command</span><span class="o">.</span><span class="n">arm_joint_move_command</span><span class="o">.</span><span class="n">trajectory</span><span class="p">)</span>
        <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">times</span><span class="p">)):</span>
            <span class="c1"># Add a new trajectory point to our trajectory</span>
            <span class="n">traj_point</span> <span class="o">=</span> <span class="n">arm_joint_traj</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">add</span><span class="p">()</span>

            <span class="n">joints</span> <span class="o">=</span> <span class="n">joint_positions</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
            <span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">joints</span><span class="p">)</span> <span class="o">==</span> <span class="mi">6</span><span class="p">,</span> <span class="s2">&quot;Need 6 joint positions per knot point for this helper&quot;</span>
            <span class="c1"># Note that although we&#39;re setting all 6 joint angles here, the actual</span>
            <span class="c1"># ArmJointTrajectory command doesn&#39;t require this. Any unset joint angles</span>
            <span class="c1"># will stay at the joint angle the robot is currently at</span>
            <span class="n">position</span> <span class="o">=</span> <span class="n">traj_point</span><span class="o">.</span><span class="n">position</span>
            <span class="n">position</span><span class="o">.</span><span class="n">sh0</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">joints</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
            <span class="n">position</span><span class="o">.</span><span class="n">sh1</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">joints</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
            <span class="n">position</span><span class="o">.</span><span class="n">el0</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">joints</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
            <span class="n">position</span><span class="o">.</span><span class="n">el1</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">joints</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span>
            <span class="n">position</span><span class="o">.</span><span class="n">wr0</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">joints</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span>
            <span class="n">position</span><span class="o">.</span><span class="n">wr1</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">joints</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span>

            <span class="k">if</span> <span class="n">joint_velocities</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                <span class="n">vels</span> <span class="o">=</span> <span class="n">joint_velocities</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
                <span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">vels</span><span class="p">)</span> <span class="o">==</span> <span class="mi">6</span><span class="p">,</span> <span class="s2">&quot;Need 6 joint velocities per knot point for this helper&quot;</span>
                <span class="c1"># Note that although we&#39;re setting all 6 joint velocities here, the actual</span>
                <span class="c1"># ArmJointTrajectory command doesn&#39;t require this. If at least 1 joint</span>
                <span class="c1"># velocity is specified, any unset joint velocities will be set to 0.</span>
                <span class="c1"># If no `velocity` is specified for this point, the robot will not constrain</span>
                <span class="c1"># the velocity of the trajectory at this point.</span>
                <span class="n">velocity</span> <span class="o">=</span> <span class="n">traj_point</span><span class="o">.</span><span class="n">velocity</span>
                <span class="n">velocity</span><span class="o">.</span><span class="n">sh0</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">vels</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
                <span class="n">velocity</span><span class="o">.</span><span class="n">sh1</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">vels</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
                <span class="n">velocity</span><span class="o">.</span><span class="n">el0</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">vels</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
                <span class="n">velocity</span><span class="o">.</span><span class="n">el1</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">vels</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span>
                <span class="n">velocity</span><span class="o">.</span><span class="n">wr0</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">vels</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span>
                <span class="n">velocity</span><span class="o">.</span><span class="n">wr1</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">vels</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span>

            <span class="c1"># Set our time_since_reference for this trajectory point</span>
            <span class="n">traj_point</span><span class="o">.</span><span class="n">time_since_reference</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">seconds_to_duration</span><span class="p">(</span><span class="n">times</span><span class="p">[</span><span class="n">i</span><span class="p">]))</span>

        <span class="c1"># Set our other optional arguments</span>
        <span class="k">if</span> <span class="n">ref_time</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a reference time if desired. If not, we&#39;ll automatically set the reference time</span>
            <span class="c1"># to be the current robot-synchronized time</span>
            <span class="n">arm_joint_traj</span><span class="o">.</span><span class="n">reference_time</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">ref_time</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">max_acc</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint acceleration if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">arm_joint_traj</span><span class="o">.</span><span class="n">maximum_acceleration</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_acc</span>
        <span class="k">if</span> <span class="n">max_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint velocity if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">arm_joint_traj</span><span class="o">.</span><span class="n">maximum_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_vel</span>

        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_cmd</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_cmd</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_cartesian_move_helper"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_cartesian_move_helper">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_cartesian_move_helper</span><span class="p">(</span><span class="n">se3_poses</span><span class="p">,</span> <span class="n">times</span><span class="p">,</span> <span class="n">root_frame_name</span><span class="p">,</span> <span class="n">wrist_tform_tool</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                  <span class="n">root_tform_task</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">se3_velocities</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ref_time</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                  <span class="n">max_acc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_linear_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_angular_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                  <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Given a set of SE3Poses, times, and optional velocities, create a synchro command</span>
<span class="sd">            containing an arm_cartesian_command.</span>

<span class="sd">        Args:</span>
<span class="sd">            se3_poses (geometry_pb2.SE3Pose): A list of length N with SE3 transforms at each knot point in our</span>
<span class="sd">                        trajectory.</span>
<span class="sd">            times: A list of length N with the corresponding time_since_reference for</span>
<span class="sd">                each of our knots.</span>
<span class="sd">            root_frame_name: The name of the root frame. It must be a valid frame name in the</span>
<span class="sd">                frame_tree.</span>
<span class="sd">            wrist_tform_tool (geometry_pb2.SE3Pose): The optional tool pose to use during the move. If unset, defaults to</span>
<span class="sd">                a pose slightly in front of the gripper&#39;s palm plate aligned with the wrist&#39;s</span>
<span class="sd">                orientation.</span>
<span class="sd">            root_tform_task (geometry_pb2.SE3Pose): The SE3 transform between the root and the task frame.</span>
<span class="sd">                If unset, it will treat the root frame as the task frame.</span>
<span class="sd">            se3_velocities (geometry_pb2.SE3Velocity): An optional list of length N with SE3 velocities at each knot point in</span>
<span class="sd">                our trajectory.</span>
<span class="sd">            ref_time: Optional reference time for the trajectory gotten from the computer. If unset, we&#39;ll use the current</span>
<span class="sd">                robot-synchronized time</span>
<span class="sd">            max_acc: Optional maximum allowable linear acceleration (m/s^2).</span>
<span class="sd">            max_linear_vel: Optional maximum allowable linear velocity (m/s).</span>
<span class="sd">            max_angular_vel: Optional maximum allowable angular velocity (rad/s).</span>
<span class="sd">            build_on_command: Option to input a RobotCommand for synchronous commands.</span>

<span class="sd">        Returns:</span>
<span class="sd">            robot_command_pb2.RobotCommand with an arm_cartesian_command filled out.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="k">assert</span> <span class="n">se3_poses</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">,</span> <span class="s2">&quot;Must pass in a list of SE3Poses&quot;</span>
        <span class="k">assert</span> <span class="n">times</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">,</span> <span class="s2">&quot;Must pass in a list of times&quot;</span>
        <span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">se3_poses</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span><span class="n">times</span><span class="p">),</span> <span class="s2">&quot;Number of poses must match number of times&quot;</span>
        <span class="k">if</span> <span class="n">se3_velocities</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">se3_velocities</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span>
                <span class="n">times</span><span class="p">),</span> <span class="s2">&quot;Number of SE3Velocities must match number of times&quot;</span>

        <span class="c1"># Create an arm_cartesian_command, and set the trajectory</span>
        <span class="n">robot_cmd</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">arm_cartesian_command</span> <span class="o">=</span> <span class="n">robot_cmd</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">arm_command</span><span class="o">.</span><span class="n">arm_cartesian_command</span>
        <span class="n">arm_cartesian_traj</span> <span class="o">=</span> <span class="n">arm_cartesian_command</span><span class="o">.</span><span class="n">pose_trajectory_in_task</span>
        <span class="n">arm_cartesian_traj</span><span class="o">.</span><span class="n">pos_interpolation</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">POS_INTERP_CUBIC</span>
        <span class="n">arm_cartesian_traj</span><span class="o">.</span><span class="n">ang_interpolation</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">ANG_INTERP_CUBIC_EULER</span>
        <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">point_time</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">times</span><span class="p">):</span>
            <span class="c1"># Add a new trajectory point to our trajectory</span>
            <span class="n">traj_point</span> <span class="o">=</span> <span class="n">arm_cartesian_traj</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">add</span><span class="p">()</span>

            <span class="n">se3pose</span> <span class="o">=</span> <span class="n">se3_poses</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>

            <span class="c1"># If it is not a geometry_pb2.SE3Pose, throw an error.</span>
            <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span>
                <span class="n">se3pose</span><span class="p">,</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">SE3Pose</span><span class="p">),</span> <span class="p">(</span><span class="s1">&#39;All poses must be of type geometry_pb2.SE3Pose&#39;</span><span class="p">)</span>

            <span class="n">traj_point</span><span class="o">.</span><span class="n">pose</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">se3pose</span><span class="p">)</span>
            <span class="k">if</span> <span class="n">se3_velocities</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                <span class="n">se3_velocity</span> <span class="o">=</span> <span class="n">se3_velocities</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>

                <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">se3_velocity</span><span class="p">,</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">SE3Velocity</span><span class="p">),</span> <span class="p">(</span>
                    <span class="s1">&#39;All Velocities must be of type geometry_pb2.SE3Velocity&#39;</span><span class="p">)</span>

                <span class="n">traj_point</span><span class="o">.</span><span class="n">velocity</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">se3_velocity</span><span class="p">)</span>

            <span class="c1"># Set our time_since_reference for this trajectory point</span>
            <span class="n">traj_point</span><span class="o">.</span><span class="n">time_since_reference</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">seconds_to_duration</span><span class="p">(</span><span class="n">point_time</span><span class="p">))</span>

        <span class="k">if</span> <span class="n">ref_time</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a reference time if desired. If not, we&#39;ll automatically set the reference time</span>
            <span class="c1"># to be the current robot-synchronized time</span>
            <span class="n">arm_cartesian_traj</span><span class="o">.</span><span class="n">reference_time</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">ref_time</span><span class="p">)</span>

        <span class="k">if</span> <span class="n">max_acc</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable linear acceleration if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">arm_cartesian_command</span><span class="o">.</span><span class="n">maximum_acceleration</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_acc</span>

        <span class="k">if</span> <span class="n">max_linear_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable linear velocity if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">arm_cartesian_command</span><span class="o">.</span><span class="n">max_linear_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_linear_vel</span>

        <span class="k">if</span> <span class="n">max_angular_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable angular velocity if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">arm_cartesian_command</span><span class="o">.</span><span class="n">max_angular_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_angular_vel</span>

        <span class="k">if</span> <span class="n">wrist_tform_tool</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set the gripper position if it is a valid SE3Pose.</span>
            <span class="c1"># If unset, defaults to a pose slightly in front of the gripper&#39;s palm plate aligned</span>
            <span class="c1"># with the wrist&#39;s orientation.</span>
            <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span>
                <span class="n">wrist_tform_tool</span><span class="p">,</span>
                <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">SE3Pose</span><span class="p">),</span> <span class="s1">&#39;All poses must be of type geometry_pb2.SE3Pose&#39;</span>

            <span class="n">arm_cartesian_command</span><span class="o">.</span><span class="n">wrist_tform_tool</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">wrist_tform_tool</span><span class="p">)</span>

        <span class="k">if</span> <span class="n">root_tform_task</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set the transformation from the root frame to the task frame if it is a valid SE3Pose</span>
            <span class="c1"># If unset, it will be assumed that the root frame is the task frame</span>
            <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span>
                <span class="n">root_tform_task</span><span class="p">,</span>
                <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">SE3Pose</span><span class="p">),</span> <span class="s1">&#39;All poses must be of type geometry_pb2.SE3Pose&#39;</span>

            <span class="n">arm_cartesian_command</span><span class="o">.</span><span class="n">root_tform_task</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">root_tform_task</span><span class="p">)</span>

        <span class="c1"># If the root frame name is invalid the command will be rejected</span>
        <span class="n">arm_cartesian_command</span><span class="o">.</span><span class="n">root_frame_name</span> <span class="o">=</span> <span class="n">root_frame_name</span>

        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_cmd</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_cmd</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.claw_gripper_command_helper"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.claw_gripper_command_helper">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">claw_gripper_command_helper</span><span class="p">(</span>
        <span class="n">gripper_positions</span><span class="p">,</span>
        <span class="n">times</span><span class="p">,</span>
        <span class="n">gripper_velocities</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
        <span class="n">ref_time</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
        <span class="n">max_acc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
        <span class="n">max_vel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
        <span class="n">disable_force_on_contact</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
        <span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
        <span class="n">max_torque</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
    <span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Given a set of gripper positions, times, and optional velocities, create a synchro command.</span>

<span class="sd">        Args:</span>
<span class="sd">            gripper_positions: A list of length N with joint positions at each knot point in our</span>
<span class="sd">                            trajectory.</span>
<span class="sd">            times: A list of length N with the corresponding time_since_reference for each of our knots</span>
<span class="sd">            gripper_velocities: Optional joint velocities at each knot. Same structure as gripper_positions.</span>
<span class="sd">            ref_time: Optional robot reference time. If unset, we&#39;ll use the current synchronized robot</span>
<span class="sd">                        time. Setting this is useful for getting a consistent trajectory over a long</span>
<span class="sd">                        period of time when many ClawGripperCommandRequest commands are chained together.</span>
<span class="sd">            max_acc: Optional maximum allowable gripper acceleration. Not setting this will lead to the</span>
<span class="sd">                        robot using a relatively safe low default. If the user is sure their gripper</span>
<span class="sd">                        trajectory is safe and achievable, this can be set to a large value so it</span>
<span class="sd">                        doesn&#39;t get in the way.</span>
<span class="sd">            max_vel: Optional maximum allowable gripper velocity. Same thing about defaults as max_acc.</span>
<span class="sd">            disable_force_on_contact: Whether to switch the gripper to force control on contact detection.</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and mobility_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>
<span class="sd">            max_torque: Optional Maximum torque applied if contact detected closing the gripper. If</span>
<span class="sd">                unspecified, a default value of 5.5 (Nm) will be used.</span>

<span class="sd">        Returns:</span>
<span class="sd">            robot_command_pb2.RobotCommand with a claw_gripper_command filled out.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">assert</span> <span class="n">gripper_positions</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">,</span> <span class="s2">&quot;Must pass in a list of gripper positions&quot;</span>
        <span class="k">assert</span> <span class="n">times</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">,</span> <span class="s2">&quot;Must pass in a list of times&quot;</span>
        <span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">gripper_positions</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span>
            <span class="n">times</span><span class="p">),</span> <span class="s2">&quot;Number of gripper positions must match number of times&quot;</span>
        <span class="k">if</span> <span class="n">gripper_velocities</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">gripper_velocities</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span>
                <span class="n">times</span><span class="p">),</span> <span class="s2">&quot;Number of gripper velocities must match number of times&quot;</span>

        <span class="c1"># Create a claw gripper command, and set the trajectory</span>
        <span class="n">robot_cmd</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">gripper_cmd</span> <span class="o">=</span> <span class="n">robot_cmd</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">gripper_command</span><span class="o">.</span><span class="n">claw_gripper_command</span>
        <span class="n">gripper_traj</span> <span class="o">=</span> <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">trajectory</span>

        <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">times</span><span class="p">)):</span>
            <span class="c1"># Add a new trajectory point to our trajectory</span>
            <span class="n">traj_point</span> <span class="o">=</span> <span class="n">gripper_traj</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">add</span><span class="p">()</span>
            <span class="n">traj_point</span><span class="o">.</span><span class="n">point</span> <span class="o">=</span> <span class="n">gripper_positions</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
            <span class="k">if</span> <span class="n">gripper_velocities</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                <span class="n">traj_point</span><span class="o">.</span><span class="n">velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">gripper_velocities</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>

            <span class="c1"># Set our time_since_reference for this trajectory point</span>
            <span class="n">traj_point</span><span class="o">.</span><span class="n">time_since_reference</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">seconds_to_duration</span><span class="p">(</span><span class="n">times</span><span class="p">[</span><span class="n">i</span><span class="p">]))</span>

        <span class="c1"># Set our other optional arguments</span>
        <span class="k">if</span> <span class="n">ref_time</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a reference time if desired. If not, we&#39;ll automatically set the reference time</span>
            <span class="c1"># to be the current robot-synchronized time</span>
            <span class="n">gripper_traj</span><span class="o">.</span><span class="n">reference_time</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="n">ref_time</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">max_acc</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint acceleration if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_acceleration</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_acc</span>
        <span class="k">if</span> <span class="n">max_vel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Set a maximum allowable joint velocity if desired.</span>
            <span class="c1"># If unset, a safe default will be used</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_open_close_velocity</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_vel</span>
        <span class="k">if</span> <span class="n">max_torque</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># Maximum torque applied if contact detected closing the gripper.</span>
            <span class="c1"># If unspecified, a default value of 5.5 (Nm) will be used.</span>
            <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">maximum_torque</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">max_torque</span>

        <span class="n">gripper_cmd</span><span class="o">.</span><span class="n">disable_force_on_contact</span> <span class="o">=</span> <span class="n">disable_force_on_contact</span>

        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_cmd</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_cmd</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.arm_joint_freeze_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.arm_joint_freeze_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">arm_joint_freeze_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Returns a RobotCommand with an ArmCommand that will freeze the arm&#39;s joints in place.</span>

<span class="sd">        Args:</span>
<span class="sd">            build_on_command: Option to input a RobotCommand (not containing a full_body_command). An</span>
<span class="sd">                arm_command and mobility_command from this incoming RobotCommand will be added</span>
<span class="sd">                to the returned RobotCommand.</span>

<span class="sd">        Returns:</span>
<span class="sd">            robot_command_pb2.RobotCommand</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">robot_cmd</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">()</span>
        <span class="n">robot_cmd</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">arm_command</span><span class="o">.</span><span class="n">arm_joint_move_command</span><span class="o">.</span><span class="n">trajectory</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">add</span><span class="p">()</span>

        <span class="k">if</span> <span class="n">build_on_command</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">build_synchro_command</span><span class="p">(</span><span class="n">build_on_command</span><span class="p">,</span> <span class="n">robot_cmd</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_cmd</span></div>

    <span class="c1">########################</span>
    <span class="c1"># Spot mobility params #</span>
    <span class="c1">########################</span>

<div class="viewcode-block" id="RobotCommandBuilder.mobility_params"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.mobility_params">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">mobility_params</span><span class="p">(</span><span class="n">body_height</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">footprint_R_body</span><span class="o">=</span><span class="n">geometry</span><span class="o">.</span><span class="n">EulerZXY</span><span class="p">(),</span>
                        <span class="n">locomotion_hint</span><span class="o">=</span><span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">HINT_AUTO</span><span class="p">,</span> <span class="n">stair_hint</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
                        <span class="n">external_force_params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">stairs_mode</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Helper to create Mobility params for spot mobility commands. This function is designed</span>
<span class="sd">        to help get started issuing commands, but lots of options are not exposed via this</span>
<span class="sd">        interface. See spot.robot_command_pb2 for more details. If unset, good defaults will be</span>
<span class="sd">        chosen by the robot.</span>

<span class="sd">        Args:</span>
<span class="sd">            body_height: Height, meters, relative to a nominal stand height.</span>
<span class="sd">            footprint_R_body(EulerZXY): The orientation of the body frame with respect to the</span>
<span class="sd">                                        footprint frame (gravity aligned framed with yaw computed</span>
<span class="sd">                                        from the stance feet)</span>
<span class="sd">            locomotion_hint: Locomotion hint to use for the command.</span>
<span class="sd">            stair_hint: Boolean to specify if stair mode should be used. Deprecated in favor of stairs_mode</span>
<span class="sd">                                        and ignored if stairs_mode set.</span>
<span class="sd">            external_force_params(spot.BodyExternalForceParams): Robot body external force</span>
<span class="sd">                                                                 parameters.</span>
<span class="sd">            stairs_mode: StairsMode enum specifying stairs mode as On, Auto, or Off.</span>

<span class="sd">        Returns:</span>
<span class="sd">            spot.MobilityParams, params for spot mobility commands.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="c1"># Simplified body control params</span>
        <span class="n">position</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Vec3</span><span class="p">(</span><span class="n">z</span><span class="o">=</span><span class="n">body_height</span><span class="p">)</span>
        <span class="n">rotation</span> <span class="o">=</span> <span class="n">footprint_R_body</span><span class="o">.</span><span class="n">to_quaternion</span><span class="p">()</span>
        <span class="n">pose</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">SE3Pose</span><span class="p">(</span><span class="n">position</span><span class="o">=</span><span class="n">position</span><span class="p">,</span> <span class="n">rotation</span><span class="o">=</span><span class="n">rotation</span><span class="p">)</span>
        <span class="n">point</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">SE3TrajectoryPoint</span><span class="p">(</span><span class="n">pose</span><span class="o">=</span><span class="n">pose</span><span class="p">)</span>
        <span class="n">traj</span> <span class="o">=</span> <span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">SE3Trajectory</span><span class="p">(</span><span class="n">points</span><span class="o">=</span><span class="p">[</span><span class="n">point</span><span class="p">])</span>
        <span class="n">body_control</span> <span class="o">=</span> <span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">BodyControlParams</span><span class="p">(</span><span class="n">base_offset_rt_footprint</span><span class="o">=</span><span class="n">traj</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">MobilityParams</span><span class="p">(</span>
            <span class="n">body_control</span><span class="o">=</span><span class="n">body_control</span><span class="p">,</span> <span class="n">locomotion_hint</span><span class="o">=</span><span class="n">locomotion_hint</span><span class="p">,</span> <span class="n">stair_hint</span><span class="o">=</span><span class="n">stair_hint</span><span class="p">,</span>
            <span class="n">external_force_params</span><span class="o">=</span><span class="n">external_force_params</span><span class="p">,</span> <span class="n">stairs_mode</span><span class="o">=</span><span class="n">stairs_mode</span><span class="p">)</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.body_pose"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.body_pose">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">body_pose</span><span class="p">(</span><span class="n">frame_name</span><span class="p">,</span> <span class="n">body_pose</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Helper to create a BodyControlParams.BodyPose from a single desired `body_pose` relative to `frame_name`.</span>

<span class="sd">        Args:</span>
<span class="sd">            frame_name(string): Name of the frame relative to which `body_pose` is expressed.</span>
<span class="sd">            body_pose(geometry_pb2.SE3Pose): Protobuf message specifying the desired pose of the</span>
<span class="sd">                body.</span>
<span class="sd">        Returns:</span>
<span class="sd">            spot.BodyControlParams.BodyPose, specifies the desired body pose for a StandCommand</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">BodyControlParams</span><span class="o">.</span><span class="n">BodyPose</span><span class="p">(</span>
            <span class="n">root_frame_name</span><span class="o">=</span><span class="n">frame_name</span><span class="p">,</span> <span class="n">base_offset_rt_root</span><span class="o">=</span><span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">SE3Trajectory</span><span class="p">(</span>
                <span class="n">points</span><span class="o">=</span><span class="p">[</span><span class="n">trajectory_pb2</span><span class="o">.</span><span class="n">SE3TrajectoryPoint</span><span class="p">(</span><span class="n">pose</span><span class="o">=</span><span class="n">body_pose</span><span class="p">)]))</span></div>

<div class="viewcode-block" id="RobotCommandBuilder.build_body_external_forces"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.build_body_external_forces">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">build_body_external_forces</span><span class="p">(</span>
            <span class="n">external_force_indicator</span><span class="o">=</span><span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">BodyExternalForceParams</span><span class="o">.</span><span class="n">EXTERNAL_FORCE_NONE</span><span class="p">,</span>
            <span class="n">override_external_force_vec</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Helper to create Mobility params.</span>

<span class="sd">        This function allows the user to enable an external force estimator, or set a vector of</span>
<span class="sd">        forces (in the body frame) which override the estimator with constant external forces.</span>

<span class="sd">        Args:</span>
<span class="sd">            external_force_indicator: Indicates if the external force estimator should be</span>
<span class="sd">                                      enabled/disabled or an override force should be used. Can be</span>
<span class="sd">                                      specified as one of three values:</span>
<span class="sd">                                      spot_command_pb2.BodyExternalForceParams.{</span>
<span class="sd">                                      EXTERNAL_FORCE_NONE, EXTERNAL_FORCE_USE_ESTIMATE,</span>
<span class="sd">                                      EXTERNAL_FORCE_USE_OVERRIDE }</span>
<span class="sd">            override_external_force_vec: x/y/z list of forces in the body frame. Only used when the</span>
<span class="sd">                                         indicator specifies EXTERNAL_FORCE_USE_OVERRIDE</span>

<span class="sd">        Returns:</span>
<span class="sd">            spot.MobilityParams, params for spot mobility commands.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="n">external_force_indicator</span> <span class="o">==</span> <span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">BodyExternalForceParams</span><span class="o">.</span><span class="n">EXTERNAL_FORCE_USE_OVERRIDE</span><span class="p">:</span>
            <span class="k">if</span> <span class="n">override_external_force_vec</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
                <span class="c1"># Default the override forces to all zeros if none are specified</span>
                <span class="n">override_external_force_vec</span> <span class="o">=</span> <span class="p">(</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">)</span>
            <span class="n">ext_forces</span> <span class="o">=</span> <span class="n">geometry_pb2</span><span class="o">.</span><span class="n">Vec3</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">override_external_force_vec</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
                                           <span class="n">y</span><span class="o">=</span><span class="n">override_external_force_vec</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span>
                                           <span class="n">z</span><span class="o">=</span><span class="n">override_external_force_vec</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
            <span class="k">return</span> <span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">BodyExternalForceParams</span><span class="p">(</span>
                <span class="n">external_force_indicator</span><span class="o">=</span><span class="n">external_force_indicator</span><span class="p">,</span> <span class="n">frame_name</span><span class="o">=</span><span class="n">BODY_FRAME_NAME</span><span class="p">,</span>
                <span class="n">external_force_override</span><span class="o">=</span><span class="n">ext_forces</span><span class="p">)</span>
        <span class="k">elif</span> <span class="p">(</span><span class="n">external_force_indicator</span>
              <span class="o">==</span> <span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">BodyExternalForceParams</span><span class="o">.</span><span class="n">EXTERNAL_FORCE_NONE</span> <span class="ow">or</span>
              <span class="n">external_force_indicator</span>
              <span class="o">==</span> <span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">BodyExternalForceParams</span><span class="o">.</span><span class="n">EXTERNAL_FORCE_USE_ESTIMATE</span><span class="p">):</span>
            <span class="k">return</span> <span class="n">spot_command_pb2</span><span class="o">.</span><span class="n">BodyExternalForceParams</span><span class="p">(</span>
                <span class="n">external_force_indicator</span><span class="o">=</span><span class="n">external_force_indicator</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="kc">None</span></div>

    <span class="c1">####################</span>
    <span class="c1"># Helper functions #</span>
    <span class="c1">####################</span>
    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">_to_any</span><span class="p">(</span><span class="n">params</span><span class="p">):</span>
        <span class="n">any_params</span> <span class="o">=</span> <span class="n">any_pb2</span><span class="o">.</span><span class="n">Any</span><span class="p">()</span>
        <span class="n">any_params</span><span class="o">.</span><span class="n">Pack</span><span class="p">(</span><span class="n">params</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">any_params</span>

<div class="viewcode-block" id="RobotCommandBuilder.build_synchro_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.RobotCommandBuilder.build_synchro_command">[docs]</a>    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">build_synchro_command</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot; Combines multiple commands into one command. There&#39;s no intelligence here on</span>
<span class="sd">        duplicate commands.</span>

<span class="sd">        Args:</span>
<span class="sd">            RobotCommand containing only either mobility commands or synchro commands</span>
<span class="sd">        Returns:</span>
<span class="sd">            RobotCommand containing a synchro command &quot;&quot;&quot;</span>
        <span class="n">mobility_request</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="n">arm_request</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="n">gripper_request</span> <span class="o">=</span> <span class="kc">None</span>

        <span class="k">for</span> <span class="n">command</span> <span class="ow">in</span> <span class="n">args</span><span class="p">:</span>
            <span class="k">if</span> <span class="n">command</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s1">&#39;full_body_command&#39;</span><span class="p">):</span>
                <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s1">&#39;this function only takes RobotCommands containing synchro cmds&#39;</span><span class="p">)</span>
            <span class="k">elif</span> <span class="n">command</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s1">&#39;synchronized_command&#39;</span><span class="p">):</span>
                <span class="k">if</span> <span class="n">command</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s1">&#39;mobility_command&#39;</span><span class="p">):</span>
                    <span class="n">mobility_request</span> <span class="o">=</span> <span class="n">command</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">mobility_command</span>
                <span class="k">if</span> <span class="n">command</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s1">&#39;arm_command&#39;</span><span class="p">):</span>
                    <span class="n">arm_request</span> <span class="o">=</span> <span class="n">command</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">arm_command</span>
                <span class="k">if</span> <span class="n">command</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s1">&#39;gripper_command&#39;</span><span class="p">):</span>
                    <span class="n">gripper_request</span> <span class="o">=</span> <span class="n">command</span><span class="o">.</span><span class="n">synchronized_command</span><span class="o">.</span><span class="n">gripper_command</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;skipping empty robot command&#39;</span><span class="p">)</span>

        <span class="k">if</span> <span class="p">(</span><span class="n">mobility_request</span> <span class="ow">or</span> <span class="n">arm_request</span> <span class="ow">or</span> <span class="n">gripper_request</span><span class="p">):</span>
            <span class="n">synchronized_command</span> <span class="o">=</span> <span class="n">synchronized_command_pb2</span><span class="o">.</span><span class="n">SynchronizedCommand</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span>
                <span class="n">mobility_command</span><span class="o">=</span><span class="n">mobility_request</span><span class="p">,</span> <span class="n">arm_command</span><span class="o">=</span><span class="n">arm_request</span><span class="p">,</span>
                <span class="n">gripper_command</span><span class="o">=</span><span class="n">gripper_request</span><span class="p">)</span>
            <span class="n">robot_command</span> <span class="o">=</span> <span class="n">robot_command_pb2</span><span class="o">.</span><span class="n">RobotCommand</span><span class="p">(</span>
                <span class="n">synchronized_command</span><span class="o">=</span><span class="n">synchronized_command</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s2">&quot;Nothing to build here&quot;</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">robot_command</span></div></div>


<div class="viewcode-block" id="blocking_command"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.blocking_command">[docs]</a><span class="k">def</span> <span class="nf">blocking_command</span><span class="p">(</span><span class="n">command_client</span><span class="p">,</span> <span class="n">command</span><span class="p">,</span> <span class="n">check_status_fn</span><span class="p">,</span> <span class="n">end_time_secs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">timeout_sec</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
                     <span class="n">update_frequency</span><span class="o">=</span><span class="mf">1.0</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Helper function which uses the RobotCommandService to execute the given command.</span>

<span class="sd">    Blocks until check_status_fn return true, or raises an exception if the command times out or fails.</span>
<span class="sd">    This helper checks the main full_body/synchronized command status (RobotCommandFeedbackStatus), but</span>
<span class="sd">    the caller should check the status of the specific commands (stand, stow, selfright, etc.) in the callback.</span>

<span class="sd">    Args:</span>
<span class="sd">        command_client: RobotCommand client.</span>
<span class="sd">        command: The robot command to issue to the robot.</span>
<span class="sd">        check_status_fn: A callback that accepts RobotCommandFeedbackResponse and returns True when the</span>
<span class="sd">                         correct statuses are achieved for the specific requested command and throws</span>
<span class="sd">                         CommandFailedErrorWithFeedback if an error state occurs.</span>
<span class="sd">        end_time_sec: The local end time of the command (will be converted to robot time)</span>
<span class="sd">        timeout_sec: Timeout for the rpc in seconds.</span>
<span class="sd">        update_frequency: Update frequency for the command in Hz.</span>

<span class="sd">    Raises:</span>
<span class="sd">        CommandFailedErrorWithFeedback: Command feedback from robot is not STATUS_PROCESSING.</span>
<span class="sd">        bosdyn.client.robot_command.CommandTimedOutError: Command took longer than provided</span>
<span class="sd">            timeout.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="nf">raise_not_processing</span><span class="p">(</span><span class="n">command_id</span><span class="p">,</span> <span class="n">feedback_status</span><span class="p">,</span> <span class="n">response</span><span class="p">):</span>
        <span class="k">raise</span> <span class="n">CommandFailedErrorWithFeedback</span><span class="p">(</span>
            <span class="s1">&#39;Command (ID </span><span class="si">{}</span><span class="s1">) no longer processing (</span><span class="si">{}</span><span class="s1">)&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                <span class="n">command_id</span><span class="p">,</span>
                <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">RobotCommandFeedbackStatus</span><span class="o">.</span><span class="n">Status</span><span class="o">.</span><span class="n">Name</span><span class="p">(</span><span class="n">feedback_status</span><span class="p">)),</span>
            <span class="n">response</span><span class="p">)</span>

    <span class="n">start_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
    <span class="n">end_time</span> <span class="o">=</span> <span class="n">start_time</span> <span class="o">+</span> <span class="n">timeout_sec</span>
    <span class="n">update_time</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="n">update_frequency</span>

    <span class="n">command_id</span> <span class="o">=</span> <span class="n">command_client</span><span class="o">.</span><span class="n">robot_command</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="n">timeout_sec</span><span class="p">,</span>
                                              <span class="n">end_time_secs</span><span class="o">=</span><span class="n">end_time_secs</span><span class="p">)</span>

    <span class="n">now</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
    <span class="k">while</span> <span class="n">now</span> <span class="o">&lt;</span> <span class="n">end_time</span><span class="p">:</span>
        <span class="n">time_until_timeout</span> <span class="o">=</span> <span class="n">end_time</span> <span class="o">-</span> <span class="n">now</span>
        <span class="n">rpc_timeout</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">time_until_timeout</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
        <span class="n">start_call_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="n">response</span> <span class="o">=</span> <span class="n">command_client</span><span class="o">.</span><span class="n">robot_command_feedback</span><span class="p">(</span><span class="n">command_id</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="n">rpc_timeout</span><span class="p">)</span>
        <span class="k">except</span> <span class="n">TimedOutError</span><span class="p">:</span>
            <span class="c1"># Excuse the TimedOutError and let the while check bail us out if we&#39;re out of time.</span>
            <span class="k">pass</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="c1"># Check the high level robot command status&#39;</span>
            <span class="k">if</span> <span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;full_body_feedback&quot;</span><span class="p">):</span>
                <span class="n">full_body_status</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">full_body_feedback</span><span class="o">.</span><span class="n">status</span>
                <span class="k">if</span> <span class="n">full_body_status</span> <span class="o">!=</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">RobotCommandFeedbackStatus</span><span class="o">.</span><span class="n">STATUS_PROCESSING</span><span class="p">:</span>
                    <span class="n">raise_not_processing</span><span class="p">(</span><span class="n">command_id</span><span class="p">,</span> <span class="n">full_body_status</span><span class="p">,</span> <span class="n">response</span><span class="p">)</span>
            <span class="k">elif</span> <span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;synchronized_feedback&quot;</span><span class="p">):</span>
                <span class="n">synchro_fb</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span>
                <span class="c1"># Mobility Feedback</span>
                <span class="k">if</span> <span class="n">synchro_fb</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;mobility_command_feedback&quot;</span><span class="p">):</span>
                    <span class="n">mob_status</span> <span class="o">=</span> <span class="n">synchro_fb</span><span class="o">.</span><span class="n">mobility_command_feedback</span><span class="o">.</span><span class="n">status</span>
                    <span class="k">if</span> <span class="n">mob_status</span> <span class="o">!=</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">RobotCommandFeedbackStatus</span><span class="o">.</span><span class="n">STATUS_PROCESSING</span><span class="p">:</span>
                        <span class="n">raise_not_processing</span><span class="p">(</span><span class="n">command_id</span><span class="p">,</span> <span class="n">mob_status</span><span class="p">,</span> <span class="n">response</span><span class="p">)</span>
                <span class="c1"># Arm Feedback</span>
                <span class="k">if</span> <span class="n">synchro_fb</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;arm_command_feedback&quot;</span><span class="p">):</span>
                    <span class="n">arm_status</span> <span class="o">=</span> <span class="n">synchro_fb</span><span class="o">.</span><span class="n">arm_command_feedback</span><span class="o">.</span><span class="n">status</span>
                    <span class="k">if</span> <span class="n">arm_status</span> <span class="o">!=</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">RobotCommandFeedbackStatus</span><span class="o">.</span><span class="n">STATUS_PROCESSING</span><span class="p">:</span>
                        <span class="n">raise_not_processing</span><span class="p">(</span><span class="n">command_id</span><span class="p">,</span> <span class="n">arm_status</span><span class="p">,</span> <span class="n">response</span><span class="p">)</span>
                <span class="c1"># Gripper Feedback</span>
                <span class="k">if</span> <span class="n">synchro_fb</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;gripper_command_feedback&quot;</span><span class="p">):</span>
                    <span class="n">gripper_status</span> <span class="o">=</span> <span class="n">synchro_fb</span><span class="o">.</span><span class="n">gripper_command_feedback</span><span class="o">.</span><span class="n">status</span>
                    <span class="k">if</span> <span class="n">gripper_status</span> <span class="o">!=</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">RobotCommandFeedbackStatus</span><span class="o">.</span><span class="n">STATUS_PROCESSING</span><span class="p">:</span>
                        <span class="n">raise_not_processing</span><span class="p">(</span><span class="n">command_id</span><span class="p">,</span> <span class="n">gripper_status</span><span class="p">,</span> <span class="n">response</span><span class="p">)</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="k">raise</span> <span class="n">CommandFailedErrorWithFeedback</span><span class="p">(</span>
                    <span class="s1">&#39;Command (ID </span><span class="si">{}</span><span class="s1">) has neither full body nor synchronized feedback&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">command_id</span><span class="p">),</span> <span class="n">response</span><span class="p">)</span>

            <span class="c1"># Check low level command specific status&#39;</span>
            <span class="k">if</span> <span class="n">check_status_fn</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
                <span class="k">return</span>

        <span class="n">delta_t</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">start_call_time</span>
        <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="nb">min</span><span class="p">(</span><span class="n">delta_t</span><span class="p">,</span> <span class="n">update_time</span><span class="p">),</span> <span class="mf">0.0</span><span class="p">))</span>
        <span class="n">now</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>

    <span class="k">raise</span> <span class="n">CommandTimedOutError</span><span class="p">(</span>
        <span class="s2">&quot;Took longer than </span><span class="si">{:.1f}</span><span class="s2"> seconds to execute the command.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">now</span> <span class="o">-</span> <span class="n">start_time</span><span class="p">))</span></div>


<div class="viewcode-block" id="blocking_stand"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.blocking_stand">[docs]</a><span class="k">def</span> <span class="nf">blocking_stand</span><span class="p">(</span><span class="n">command_client</span><span class="p">,</span> <span class="n">timeout_sec</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">update_frequency</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Helper function which uses the RobotCommandService to stand.</span>

<span class="sd">    Blocks until robot is standing, or raises an exception if the command times out or fails.</span>

<span class="sd">    Args:</span>
<span class="sd">        command_client: RobotCommand client.</span>
<span class="sd">        timeout_sec: Timeout for the command in seconds.</span>
<span class="sd">        update_frequency: Update frequency for the command in Hz.</span>
<span class="sd">        params(spot.MobilityParams): Spot specific parameters for mobility commands to optionally set say body_height</span>

<span class="sd">    Raises:</span>
<span class="sd">        CommandFailedErrorWithFeedback: Command feedback from robot is not STATUS_PROCESSING.</span>
<span class="sd">        bosdyn.client.robot_command.CommandTimedOutError: Command took longer than provided</span>
<span class="sd">            timeout.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="nf">check_stand_status</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
        <span class="n">status</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span><span class="o">.</span><span class="n">mobility_command_feedback</span><span class="o">.</span><span class="n">stand_feedback</span><span class="o">.</span><span class="n">status</span>
        <span class="k">return</span> <span class="n">status</span> <span class="o">==</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">StandCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_IS_STANDING</span>

    <span class="n">stand_command</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">synchro_stand_command</span><span class="p">(</span><span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>
    <span class="n">blocking_command</span><span class="p">(</span><span class="n">command_client</span><span class="p">,</span> <span class="n">stand_command</span><span class="p">,</span> <span class="n">check_stand_status</span><span class="p">,</span> <span class="n">timeout_sec</span><span class="o">=</span><span class="n">timeout_sec</span><span class="p">,</span>
                     <span class="n">update_frequency</span><span class="o">=</span><span class="n">update_frequency</span><span class="p">)</span></div>


<div class="viewcode-block" id="blocking_sit"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.blocking_sit">[docs]</a><span class="k">def</span> <span class="nf">blocking_sit</span><span class="p">(</span><span class="n">command_client</span><span class="p">,</span> <span class="n">timeout_sec</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">update_frequency</span><span class="o">=</span><span class="mf">1.0</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Helper function which uses the RobotCommandService to sit.</span>

<span class="sd">    Blocks until robot is sitting, or raises an exception if the command times out or fails.</span>

<span class="sd">    Args:</span>
<span class="sd">        command_client: RobotCommand client.</span>
<span class="sd">        timeout_sec: Timeout for the command in seconds.</span>
<span class="sd">        update_frequency: Update frequency for the command in Hz.</span>

<span class="sd">    Raises:</span>
<span class="sd">        CommandFailedErrorWithFeedback: Command feedback from robot is not STATUS_PROCESSING.</span>
<span class="sd">        bosdyn.client.robot_command.CommandTimedOutError: Command took longer than provided</span>
<span class="sd">            timeout.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="nf">check_sit_status</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
        <span class="n">status</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span><span class="o">.</span><span class="n">mobility_command_feedback</span><span class="o">.</span><span class="n">sit_feedback</span><span class="o">.</span><span class="n">status</span>
        <span class="k">return</span> <span class="n">status</span> <span class="o">==</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">SitCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_IS_SITTING</span>

    <span class="n">sit_command</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">synchro_sit_command</span><span class="p">()</span>
    <span class="n">blocking_command</span><span class="p">(</span><span class="n">command_client</span><span class="p">,</span> <span class="n">sit_command</span><span class="p">,</span> <span class="n">check_sit_status</span><span class="p">,</span> <span class="n">timeout_sec</span><span class="o">=</span><span class="n">timeout_sec</span><span class="p">,</span>
                     <span class="n">update_frequency</span><span class="o">=</span><span class="n">update_frequency</span><span class="p">)</span></div>


<div class="viewcode-block" id="blocking_selfright"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.blocking_selfright">[docs]</a><span class="k">def</span> <span class="nf">blocking_selfright</span><span class="p">(</span><span class="n">command_client</span><span class="p">,</span> <span class="n">timeout_sec</span><span class="o">=</span><span class="mi">30</span><span class="p">,</span> <span class="n">update_frequency</span><span class="o">=</span><span class="mf">1.0</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Helper function which uses the RobotCommandService to self-right.</span>

<span class="sd">    Blocks until self-right has completed, or raises an exception if the command times out or fails.</span>

<span class="sd">    Args:</span>
<span class="sd">        command_client: RobotCommand client.</span>
<span class="sd">        timeout_sec: Timeout for the command in seconds.</span>
<span class="sd">        update_frequency: Update frequency for the command in Hz.</span>

<span class="sd">    Raises:</span>
<span class="sd">        CommandFailedErrorWithFeedback: Command feedback from robot is not STATUS_PROCESSING.</span>
<span class="sd">        bosdyn.client.robot_command.CommandTimedOutError: Command took longer than provided</span>
<span class="sd">            timeout.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="nf">check_self_right_status</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
        <span class="n">status</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">full_body_feedback</span><span class="o">.</span><span class="n">selfright_feedback</span><span class="o">.</span><span class="n">status</span>
        <span class="k">return</span> <span class="n">status</span> <span class="o">==</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">SelfRightCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_COMPLETED</span>

    <span class="n">selfright_command</span> <span class="o">=</span> <span class="n">RobotCommandBuilder</span><span class="o">.</span><span class="n">selfright_command</span><span class="p">()</span>
    <span class="n">blocking_command</span><span class="p">(</span><span class="n">command_client</span><span class="p">,</span> <span class="n">selfright_command</span><span class="p">,</span> <span class="n">check_self_right_status</span><span class="p">,</span>
                     <span class="n">timeout_sec</span><span class="o">=</span><span class="n">timeout_sec</span><span class="p">,</span> <span class="n">update_frequency</span><span class="o">=</span><span class="n">update_frequency</span><span class="p">)</span></div>


<div class="viewcode-block" id="block_until_arm_arrives"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.block_until_arm_arrives">[docs]</a><span class="k">def</span> <span class="nf">block_until_arm_arrives</span><span class="p">(</span><span class="n">command_client</span><span class="p">,</span> <span class="n">cmd_id</span><span class="p">,</span> <span class="n">timeout_sec</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Helper that blocks until the arm achieves a finishing state for the specific arm command.</span>

<span class="sd">       This helper will block and check the feedback for ArmCartesianCommand, GazeCommand,</span>
<span class="sd">       ArmJointMoveCommand, NamedArmPositionsCommand, and ArmImpedanceCommand.</span>

<span class="sd">       Args:</span>
<span class="sd">        command_client: robot command client, used to request feedback</span>
<span class="sd">        cmd_id: command ID returned by the robot when the arm movement command was sent.</span>
<span class="sd">        timeout_sec: optional number of seconds after which we&#39;ll return no matter what</span>
<span class="sd">                     the robot&#39;s state is.</span>

<span class="sd">       Return values:</span>
<span class="sd">        True if successfully got to the end of the trajectory, False if the arm stalled or</span>
<span class="sd">        the move was canceled (the arm failed to reach the goal). See the proto definitions in</span>
<span class="sd">        arm_command.proto for more information about why a trajectory would succeed or fail.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="k">if</span> <span class="n">timeout_sec</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
        <span class="n">start_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
        <span class="n">end_time</span> <span class="o">=</span> <span class="n">start_time</span> <span class="o">+</span> <span class="n">timeout_sec</span>
        <span class="n">now</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>

    <span class="k">while</span> <span class="n">timeout_sec</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">now</span> <span class="o">&lt;</span> <span class="n">end_time</span><span class="p">:</span>
        <span class="n">feedback_resp</span> <span class="o">=</span> <span class="n">command_client</span><span class="o">.</span><span class="n">robot_command_feedback</span><span class="p">(</span><span class="n">cmd_id</span><span class="p">)</span>
        <span class="n">arm_feedback</span> <span class="o">=</span> <span class="n">feedback_resp</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span><span class="o">.</span><span class="n">arm_command_feedback</span>

        <span class="k">if</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;arm_cartesian_feedback&quot;</span><span class="p">):</span>
            <span class="k">if</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">arm_cartesian_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_TRAJECTORY_COMPLETE</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">True</span>
            <span class="k">elif</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">arm_cartesian_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_TRAJECTORY_STALLED</span> <span class="ow">or</span> <span class="n">feedback_resp</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span><span class="o">.</span><span class="n">arm_command_feedback</span><span class="o">.</span><span class="n">arm_cartesian_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmCartesianCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_TRAJECTORY_CANCELLED</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">False</span>
        <span class="k">elif</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;arm_gaze_feedback&quot;</span><span class="p">):</span>
            <span class="k">if</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">arm_gaze_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">GazeCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_TRAJECTORY_COMPLETE</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">True</span>
            <span class="k">elif</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">arm_gaze_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">GazeCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_TOOL_TRAJECTORY_STALLED</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">False</span>
        <span class="k">elif</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;arm_joint_move_feedback&quot;</span><span class="p">):</span>
            <span class="k">if</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">arm_joint_move_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmJointMoveCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_COMPLETE</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">True</span>
            <span class="k">elif</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">arm_joint_move_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmJointMoveCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_STALLED</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">False</span>
        <span class="k">elif</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;named_arm_position_feedback&quot;</span><span class="p">):</span>
            <span class="k">if</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">named_arm_position_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">NamedArmPositionsCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_COMPLETE</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">True</span>
            <span class="k">elif</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">named_arm_position_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">NamedArmPositionsCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_STALLED_HOLDING_ITEM</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">False</span>
        <span class="k">elif</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">HasField</span><span class="p">(</span><span class="s2">&quot;arm_impedance_feedback&quot;</span><span class="p">):</span>
            <span class="k">if</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">arm_impedance_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmImpedanceCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_TRAJECTORY_COMPLETE</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">True</span>
            <span class="k">elif</span> <span class="n">arm_feedback</span><span class="o">.</span><span class="n">arm_impedance_feedback</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">arm_command_pb2</span><span class="o">.</span><span class="n">ArmImpedanceCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_TRAJECTORY_STALLED</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">False</span>

        <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mf">0.1</span><span class="p">)</span>
        <span class="n">now</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
    <span class="k">return</span> <span class="kc">False</span></div>


<div class="viewcode-block" id="block_for_trajectory_cmd"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html#bosdyn.client.robot_command.block_for_trajectory_cmd">[docs]</a><span class="k">def</span> <span class="nf">block_for_trajectory_cmd</span><span class="p">(</span>
        <span class="n">command_client</span><span class="p">,</span> <span class="n">cmd_id</span><span class="p">,</span>
        <span class="n">trajectory_end_statuses</span><span class="o">=</span><span class="p">(</span><span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">SE2TrajectoryCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">STATUS_STOPPED</span><span class="p">,),</span>
        <span class="n">body_movement_statuses</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">feedback_interval_secs</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">timeout_sec</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">logger</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Helper that blocks until a trajectory command reaches a desired goal state or a timeout is reached.</span>

<span class="sd">       Args:</span>
<span class="sd">        command_client (RobotCommandClient): the client used to request feedback</span>
<span class="sd">        cmd_id (int): command ID returned by the robot when the trajectory command was sent</span>
<span class="sd">        trajectory_end_statuses (set of SE2TrajectoryCommand.Feedback.Status): the feedback must have a</span>
<span class="sd">            status which is included in this set of statuses to be considered successfully complete.</span>
<span class="sd">            By default, this includes only the &quot;STATUS_STOPPED&quot; end condition.</span>
<span class="sd">        body_movement_statuses (set of SE2TrajectoryCommand.Feedback.BodyMovementStatus): the body</span>
<span class="sd">            movement status must be one of these statuses to be considered successfully complete. By</span>
<span class="sd">            default, this is &quot;None&quot;, which means any body movement status will be accepted.</span>
<span class="sd">        feedback_interval_secs (float): The time (in seconds) to wait before each feedback request checking</span>
<span class="sd">            if the trajectory is complete. Defaults to checking at 10 Hz (requests every 0.1 seconds).</span>
<span class="sd">        timeout_sec (float): optional number of seconds after which we&#39;ll return no matter what the</span>
<span class="sd">            robot&#39;s state is.</span>
<span class="sd">        logger (logging.Logger): The logger print debug statements with. If none, no debug printouts</span>
<span class="sd">            will be sent.</span>

<span class="sd">       Return values:</span>
<span class="sd">        True if reaches STATUS_STOPPED, False otherwise.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">if</span> <span class="n">timeout_sec</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
        <span class="n">start_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
        <span class="n">end_time</span> <span class="o">=</span> <span class="n">start_time</span> <span class="o">+</span> <span class="n">timeout_sec</span>
        <span class="n">now</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>

    <span class="k">while</span> <span class="n">timeout_sec</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">now</span> <span class="o">&lt;</span> <span class="n">end_time</span><span class="p">:</span>
        <span class="n">feedback_resp</span> <span class="o">=</span> <span class="n">command_client</span><span class="o">.</span><span class="n">robot_command_feedback</span><span class="p">(</span><span class="n">cmd_id</span><span class="p">)</span>

        <span class="n">current_trajectory_state</span> <span class="o">=</span> <span class="n">feedback_resp</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span><span class="o">.</span><span class="n">mobility_command_feedback</span><span class="o">.</span><span class="n">se2_trajectory_feedback</span><span class="o">.</span><span class="n">status</span>
        <span class="n">body_movement_state</span> <span class="o">=</span> <span class="n">feedback_resp</span><span class="o">.</span><span class="n">feedback</span><span class="o">.</span><span class="n">synchronized_feedback</span><span class="o">.</span><span class="n">mobility_command_feedback</span><span class="o">.</span><span class="n">se2_trajectory_feedback</span><span class="o">.</span><span class="n">body_movement_status</span>

        <span class="k">if</span> <span class="n">logger</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">current_state_str</span> <span class="o">=</span> <span class="n">basic_command_pb2</span><span class="o">.</span><span class="n">SE2TrajectoryCommand</span><span class="o">.</span><span class="n">Feedback</span><span class="o">.</span><span class="n">Status</span><span class="o">.</span><span class="n">Name</span><span class="p">(</span>
                <span class="n">current_trajectory_state</span><span class="p">)</span>
            <span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">&#39;block_for_trajectory_cmd: &#39;</span> <span class="o">+</span> <span class="n">current_state_str</span><span class="p">)</span>

        <span class="k">if</span> <span class="n">current_trajectory_state</span> <span class="ow">in</span> <span class="n">trajectory_end_statuses</span><span class="p">:</span>
            <span class="c1"># Met the baseline trajectory statuses to be considered complete.</span>
            <span class="c1"># Check if there are any conditions on the body movement status.</span>
            <span class="k">if</span> <span class="n">body_movement_statuses</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">body_movement_statuses</span>
                      <span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">body_movement_state</span> <span class="ow">in</span> <span class="n">body_movement_statuses</span><span class="p">:</span>
                    <span class="k">return</span> <span class="kc">True</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="c1"># There were no body movement statuses provided, so don&#39;t gate the completion of the</span>
                <span class="c1"># trajectory on this field.</span>
                <span class="k">return</span> <span class="kc">True</span>

        <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">feedback_interval_secs</span><span class="p">)</span>
        <span class="n">now</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>

    <span class="k">if</span> <span class="n">logger</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
        <span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">&#39;block_for_trajectory_cmd: timeout exceeded.&#39;</span><span class="p">)</span>

    <span class="k">return</span> <span class="kc">False</span></div>
</pre></div>

           </div>
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
      
      &copy; Copyright 2025 Boston Dynamics. All rights reserved.
      <a href="https://www.bostondynamics.com/privacy-policy">Privacy Policy</a> | 
      <a href="https://www.bostondynamics.com/terms">Terms of Use</a>

    </p>
  </div> 

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(false);
      });
  </script>
    <!-- Theme Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXX-1"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'UA-XXXXXXX-1', {
          'anonymize_ip': false,
      });
    </script> 

</body>
</html>